module/xwindow: don't crash if there is no active window

This commit is contained in:
Daniel Eklöf 2019-01-16 16:24:56 +01:00
parent 41c53a7b2f
commit c5309abbd0

View file

@ -57,6 +57,11 @@ update_active_window(struct private *m)
return;
}
if (xcb_get_property_value_length(r) != sizeof(m->active_win)) {
free(r);
return;
}
assert(sizeof(m->active_win) == xcb_get_property_value_length(r));
memcpy(&m->active_win, xcb_get_property_value(r), sizeof(m->active_win));
free(r);