[metacity/redhat-1888993] window: fix crash in get_client_pid




commit 8f2e427d7604b0efd076c160ba447bb93ecc1190
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Oct 17 20:38:28 2020 +0300

    window: fix crash in get_client_pid
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1888993

 src/core/window.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 171b1705..978846e5 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -9288,11 +9288,15 @@ meta_window_get_client_pid (MetaWindow *self)
       spec.client = self->xwindow;
       spec.mask = XRES_CLIENT_ID_PID_MASK;
 
-      XResQueryClientIds (self->display->xdisplay,
-                          1,
-                          &spec,
-                          &num_ids,
-                          &client_ids);
+      num_ids = 0;
+      client_ids = NULL;
+
+      if (XResQueryClientIds (self->display->xdisplay,
+                              1,
+                              &spec,
+                              &num_ids,
+                              &client_ids) != Success)
+        return -1;
 
       for (i = 0; i < num_ids; i++)
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]