From c5309abbd094af50b5d4d868b70b2221ff387b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 16 Jan 2019 16:24:56 +0100 Subject: [PATCH] module/xwindow: don't crash if there is no active window --- modules/xwindow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/xwindow.c b/modules/xwindow.c index 138a748..8aa2b37 100644 --- a/modules/xwindow.c +++ b/modules/xwindow.c @@ -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);