summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-10 13:59:59 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-10 13:59:59 -0700
commit90fe017c5db9ead2e8fe64bfc1d146268a2eae97 (patch)
tree24b93d59b503437f5e10f1d7c8a215d42bb1bc2d
parentf8ff22d7d00a96ab43bab7accbd2fcc01a1b5e0c (diff)
Window_With_Name(): make sure cookies.get_net_wm_name is set
Reported by Oracle Parfait: Error: Uninitialised memory Uninitialised memory [uninitialised-mem] (CWE 456): Possible access to uninitialised memory referenced by 'cookies' at line 289 of dsimple.c in function 'recursive_Window_With_Name'. called at line 420 in function 'Window_With_Name' with cookies = &cookies. Path avoiding write at line 416 Write does not overlap at line 417 Write does not overlap at line 418 cookies allocated at line 410 cookies passed in at line 276 in function 'recursive_Window_With_Name' Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--dsimple.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dsimple.c b/dsimple.c
index fc050c9..0bb2ab8 100644
--- a/dsimple.c
+++ b/dsimple.c
@@ -414,6 +414,8 @@ Window_With_Name (
if (atom_net_wm_name && atom_utf8_string)
cookies.get_net_wm_name = xcb_get_net_wm_name (dpy, top);
+ else
+ cookies.get_net_wm_name.sequence = 0;
cookies.get_wm_name = xcb_icccm_get_wm_name (dpy, top);
cookies.query_tree = xcb_query_tree (dpy, top);
xcb_flush (dpy);