module/xwindow: don't crash if window doesn't have a correctly sized PID property

This commit is contained in:
Daniel Eklöf 2019-01-15 19:18:01 +01:00
parent d264a6a067
commit b0e384b2f3

View file

@ -99,7 +99,10 @@ update_application(struct module *mod)
}
uint32_t pid;
assert(xcb_get_property_value_length(r) == sizeof(pid));
if (xcb_get_property_value_length(r) != sizeof(pid)) {
free(r);
return;
}
memcpy(&pid, xcb_get_property_value(r), sizeof(pid));
free(r);