projects
/
suckless
/
dwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9b6a31
)
gettextprop: check result of XGetTextProperty (undefined behaviour for XFree)
author
Hiltjo Posthuma
<hiltjo@codemadness.org>
Fri, 3 Nov 2017 15:36:32 +0000
(16:36 +0100)
committer
Hiltjo Posthuma
<hiltjo@codemadness.org>
Fri, 3 Nov 2017 20:14:58 +0000
(21:14 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index b0d99c05ffed432638a943610625fa5adbbfb400..650d19f8ebe0d07160ed5a1f79d6b267eb6baf52 100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-910,8
+910,7
@@
gettextprop(Window w, Atom atom, char *text, unsigned int size)
if (!text || size == 0)
return 0;
text[0] = '\0';
- XGetTextProperty(dpy, w, &name, atom);
- if (!name.nitems)
+ if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems)
return 0;
if (name.encoding == XA_STRING)
strncpy(text, (char *)name.value, size - 1);