From 7abdf973ea7e98a6d23c8d149b3d7a95409768f1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 14 Sep 2004 19:01:16 +0000 Subject: Bug #1360: Fix a segfault by checking the return value of XQueryTree. (Johan Kiviniemi) --- xcompmgr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '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]); -- cgit v1.2.3-70-g09d2