mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 00:28:20 +00:00
[client] x11: check for null data from XGetWindowProperty
This fixes a reported segfault when a window manager fails to provide valid EWMH values. Fixes #987
This commit is contained in:
parent
32fbcaffd2
commit
3b55ac5420
@ -190,14 +190,14 @@ static void x11CheckEWMHSupport(void)
|
||||
|
||||
if (XGetWindowProperty(x11.display, DefaultRootWindow(x11.display),
|
||||
x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW,
|
||||
&type, &fmt, &num, &bytes, &data) != Success)
|
||||
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||
goto out;
|
||||
|
||||
Window * windowFromRoot = (Window *)data;
|
||||
|
||||
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
||||
x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW,
|
||||
&type, &fmt, &num, &bytes, &data) != Success)
|
||||
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||
goto out_root;
|
||||
|
||||
Window * windowFromChild = (Window *)data;
|
||||
@ -206,7 +206,7 @@ static void x11CheckEWMHSupport(void)
|
||||
|
||||
if (XGetWindowProperty(x11.display, DefaultRootWindow(x11.display),
|
||||
x11atoms._NET_SUPPORTED, 0, ~0L, False, AnyPropertyType,
|
||||
&type, &fmt, &num, &bytes, &data) != Success)
|
||||
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||
goto out_child;
|
||||
|
||||
Atom * supported = (Atom *)data;
|
||||
@ -214,7 +214,7 @@ static void x11CheckEWMHSupport(void)
|
||||
|
||||
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
||||
x11atoms._NET_WM_NAME, 0, ~0L, False, AnyPropertyType,
|
||||
&type, &fmt, &num, &bytes, &data) != Success)
|
||||
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||
goto out_supported;
|
||||
|
||||
char * wmName = (char *)data;
|
||||
|
Loading…
Reference in New Issue
Block a user