diff options
author | Adam Jackson <ajax@nwnk.net> | 2004-09-14 19:01:16 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2004-09-14 19:01:16 +0000 |
commit | 7abdf973ea7e98a6d23c8d149b3d7a95409768f1 (patch) | |
tree | b153e494527afad6389af3e07b6ca5498d910586 /xcompmgr.c | |
parent | 36005e53a518c6e028d76ff82ac7ff54e1eac9b0 (diff) |
Bug #1360: Fix a segfault by checking the return value of XQueryTree.
(Johan Kiviniemi)
Diffstat (limited to 'xcompmgr.c')
-rw-r--r-- | xcompmgr.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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]); |