Merge lp:~vanvugt/compiz/fix-1019337 into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3280
Merged at revision: 3284
Proposed branch: lp:~vanvugt/compiz/fix-1019337
Merge into: lp:compiz/0.9.8
Diff against target: 32 lines (+12/-3)
1 file modified
gtk/window-decorator/wnck.c (+12/-3)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1019337
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
jenkins (community) continuous-integration Approve
Review via email: mp+114330@code.launchpad.net

Commit message

Add extra checks to avoid passing an invalid xid to XGetWindowProperty which
would result in fatal error: BadWindow (invalid Window parameter).
(LP: #1019337)

Description of the change

Add extra checks to avoid passing an invalid xid to XGetWindowProperty which
would result in fatal error: BadWindow (invalid Window parameter).
(LP: #1019337)

UNBLOCK

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

(We aren't requring tests for gtk-window-decorator at this point)

\o/

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gtk/window-decorator/wnck.c'
--- gtk/window-decorator/wnck.c 2012-06-29 03:39:30 +0000
+++ gtk/window-decorator/wnck.c 2012-07-11 04:39:18 +0000
@@ -28,7 +28,12 @@
28const gchar *28const gchar *
29get_frame_type (WnckWindow *win)29get_frame_type (WnckWindow *win)
30{30{
31 WnckWindowType wnck_type = wnck_window_get_window_type (win);31 WnckWindowType wnck_type;
32
33 if (win == NULL)
34 return "bare";
35
36 wnck_type = wnck_window_get_window_type (win);
3237
33 switch (wnck_type)38 switch (wnck_type)
34 {39 {
@@ -40,8 +45,12 @@
40 int result, format;45 int result, format;
41 unsigned long n, left;46 unsigned long n, left;
42 unsigned char *data;47 unsigned char *data;
4348 Window xid = wnck_window_get_xid (win);
44 result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), wnck_window_get_xid (win),49
50 if (xid == None)
51 return "bare";
52
53 result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), xid,
45 net_wm_state_atom,54 net_wm_state_atom,
46 0L, 1024L, FALSE, XA_ATOM, &actual, &format,55 0L, 1024L, FALSE, XA_ATOM, &actual, &format,
47 &n, &left, &data);56 &n, &left, &data);

Subscribers

People subscribed via source and target branches