summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Pryc <michal.pryc@sun.com>2010-04-19 13:36:52 +0100
committerLucas Rocha <lucasr@litl.com>2010-04-19 13:39:12 +0100
commiteb6ed94c9eac1dae8c943041bc278b9b9e0e26b0 (patch)
treebfc1ec38058d8ce30199c14f465353e2f825fcd2 /src
parent70c689bebecccb21cf2591562466276132e54941 (diff)
Bug 615527 - zenity hangs if invalid WINDOWID is specified
Diffstat (limited to 'src')
-rw-r--r--src/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 96bf315..8f887f3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -323,13 +323,14 @@ transient_get_xterm (void)
const char *wid_str = g_getenv ("WINDOWID");
if (wid_str) {
char *wid_str_end;
+ int ret;
Window wid = strtoul (wid_str, &wid_str_end, 10);
if (*wid_str != '\0' && *wid_str_end == '\0' && wid != 0) {
XWindowAttributes attrs;
gdk_error_trap_push ();
- XGetWindowAttributes (GDK_DISPLAY(), wid, &attrs);
+ ret = XGetWindowAttributes (GDK_DISPLAY(), wid, &attrs);
gdk_flush();
- if (gdk_error_trap_pop () != 0) {
+ if (gdk_error_trap_pop () != 0 || ret == 0) {
return None;
}
return wid;