From: Ferdinand Bachmann Date: Mon, 3 Oct 2016 12:53:56 +0000 (+0200) Subject: Bugfix: NULL dereference when stickying _NET_WM_DESKTOP_ALL windows (#2488) X-Git-Tag: 4.13~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b3d8b9e8b45b999a7da19ef2c0831ec0e050530;p=i3%2Fi3 Bugfix: NULL dereference when stickying _NET_WM_DESKTOP_ALL windows (#2488) In some cases, ws will be NULL here. Originally tested with "lemonbar" --- diff --git a/src/manage.c b/src/manage.c index bbd84007..fd9226e4 100644 --- a/src/manage.c +++ b/src/manage.c @@ -433,7 +433,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki /* We ignore the hint for an internal workspace because windows in the * scratchpad also have this value, but upon restarting i3 we don't want * them to become sticky windows. */ - if (cwindow->wm_desktop == NET_WM_DESKTOP_ALL && !con_is_internal(ws)) { + if (cwindow->wm_desktop == NET_WM_DESKTOP_ALL && (ws == NULL || !con_is_internal(ws))) { DLOG("This window has _NET_WM_DESKTOP = 0xFFFFFFFF. Will float it and make it sticky.\n"); nc->sticky = true; want_floating = true;