aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2004-09-14 19:01:16 +0000
committerAdam Jackson <ajax@nwnk.net>2004-09-14 19:01:16 +0000
commit7abdf973ea7e98a6d23c8d149b3d7a95409768f1 (patch)
treeb153e494527afad6389af3e07b6ca5498d910586
parentMore effects, bug fixes, doc updates. (diff)
downloadxcman-7abdf973ea7e98a6d23c8d149b3d7a95409768f1.tar.gz
xcman-7abdf973ea7e98a6d23c8d149b3d7a95409768f1.tar.bz2
xcman-7abdf973ea7e98a6d23c8d149b3d7a95409768f1.tar.xz
Bug #1360: Fix a segfault by checking the return value of XQueryTree.
(Johan Kiviniemi)
-rw-r--r--ChangeLog6
-rw-r--r--xcompmgr.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9abcd0..467e608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-14 Adam Jackson <ajax@freedesktop.org>
+
+ * xcompmgr.c:
+ Bug #1360: Fix a segfault by checking the return value of XQueryTree.
+ (Johan Kiviniemi)
+
2004-09-10 Adam Jackson <ajax@freedesktop.org>
* xcompmgr.c:
diff --git a/xcompmgr.c b/xcompmgr.c
index 122d8b4..7e542fe 100644
--- a/xcompmgr.c
+++ b/xcompmgr.c
@@ -1297,7 +1297,13 @@ determine_wintype (Display *dpy, Window w)
if (type != winNormalAtom)
return type;
- XQueryTree (dpy, w, &root_return, &parent_return, &children, &nchildren);
+ if (!XQueryTree (dpy, w, &root_return, &parent_return, &children,
+ &nchildren))
+ {
+ /* XQueryTree failed. */
+ return winNormalAtom;
+ }
+
for (i = 0;i < nchildren;i++)
{
type = determine_wintype (dpy, children[i]);