mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +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),
|
if (XGetWindowProperty(x11.display, DefaultRootWindow(x11.display),
|
||||||
x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW,
|
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;
|
goto out;
|
||||||
|
|
||||||
Window * windowFromRoot = (Window *)data;
|
Window * windowFromRoot = (Window *)data;
|
||||||
|
|
||||||
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
||||||
x11atoms._NET_SUPPORTING_WM_CHECK, 0, ~0L, False, XA_WINDOW,
|
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;
|
goto out_root;
|
||||||
|
|
||||||
Window * windowFromChild = (Window *)data;
|
Window * windowFromChild = (Window *)data;
|
||||||
@ -206,7 +206,7 @@ static void x11CheckEWMHSupport(void)
|
|||||||
|
|
||||||
if (XGetWindowProperty(x11.display, DefaultRootWindow(x11.display),
|
if (XGetWindowProperty(x11.display, DefaultRootWindow(x11.display),
|
||||||
x11atoms._NET_SUPPORTED, 0, ~0L, False, AnyPropertyType,
|
x11atoms._NET_SUPPORTED, 0, ~0L, False, AnyPropertyType,
|
||||||
&type, &fmt, &num, &bytes, &data) != Success)
|
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||||
goto out_child;
|
goto out_child;
|
||||||
|
|
||||||
Atom * supported = (Atom *)data;
|
Atom * supported = (Atom *)data;
|
||||||
@ -214,7 +214,7 @@ static void x11CheckEWMHSupport(void)
|
|||||||
|
|
||||||
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
if (XGetWindowProperty(x11.display, *windowFromRoot,
|
||||||
x11atoms._NET_WM_NAME, 0, ~0L, False, AnyPropertyType,
|
x11atoms._NET_WM_NAME, 0, ~0L, False, AnyPropertyType,
|
||||||
&type, &fmt, &num, &bytes, &data) != Success)
|
&type, &fmt, &num, &bytes, &data) != Success || !data)
|
||||||
goto out_supported;
|
goto out_supported;
|
||||||
|
|
||||||
char * wmName = (char *)data;
|
char * wmName = (char *)data;
|
||||||
|
Loading…
Reference in New Issue
Block a user