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
1=== modified file 'gtk/window-decorator/wnck.c'
2--- gtk/window-decorator/wnck.c 2012-06-29 03:39:30 +0000
3+++ gtk/window-decorator/wnck.c 2012-07-11 04:39:18 +0000
4@@ -28,7 +28,12 @@
5 const gchar *
6 get_frame_type (WnckWindow *win)
7 {
8- WnckWindowType wnck_type = wnck_window_get_window_type (win);
9+ WnckWindowType wnck_type;
10+
11+ if (win == NULL)
12+ return "bare";
13+
14+ wnck_type = wnck_window_get_window_type (win);
15
16 switch (wnck_type)
17 {
18@@ -40,8 +45,12 @@
19 int result, format;
20 unsigned long n, left;
21 unsigned char *data;
22-
23- result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), wnck_window_get_xid (win),
24+ Window xid = wnck_window_get_xid (win);
25+
26+ if (xid == None)
27+ return "bare";
28+
29+ result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), xid,
30 net_wm_state_atom,
31 0L, 1024L, FALSE, XA_ATOM, &actual, &format,
32 &n, &left, &data);

Subscribers

People subscribed via source and target branches