all repos — dwm @ 99f78fa553f9ddb23fab73e47a408d66ca7f974c

my dwm build

gettextprop: check result of XGetTextProperty (undefined behaviour for XFree)
Hiltjo Posthuma hiltjo@codemadness.org
Fri, 03 Nov 2017 16:36:32 +0100
commit

99f78fa553f9ddb23fab73e47a408d66ca7f974c

parent

a9b6a312a77b9cc81ca8b08a95c09e9f7948d7a6

1 files changed, 1 insertions(+), 2 deletions(-)

jump to
M dwm.cdwm.c

@@ -910,8 +910,7 @@

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);