Introduction
Introduction Statistics Contact Development Disclaimer Help
gettextprop: check result of XGetTextProperty (undefined behaviour for XFree) -…
git clone git://git.suckless.org/dwm
Log
Files
Refs
README
LICENSE
---
commit 99f78fa553f9ddb23fab73e47a408d66ca7f974c
parent a9b6a312a77b9cc81ca8b08a95c09e9f7948d7a6
Author: Hiltjo Posthuma <[email protected]>
Date: Fri, 3 Nov 2017 16:36:32 +0100
gettextprop: check result of XGetTextProperty (undefined behaviour for XFree)
Diffstat:
M dwm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/dwm.c b/dwm.c
@@ -910,8 +910,7 @@ gettextprop(Window w, Atom atom, char *text, unsigned int s…
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);
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.