]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: NULL dereference when stickying _NET_WM_DESKTOP_ALL windows (#2488)
authorFerdinand Bachmann <theferdi265@gmail.com>
Mon, 3 Oct 2016 12:53:56 +0000 (14:53 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 3 Oct 2016 12:53:56 +0000 (05:53 -0700)
In some cases, ws will be NULL here.

Originally tested with "lemonbar"

src/manage.c

index bbd8400726a17d271e3641838f4fd392b8792764..fd9226e4978191bd177a94f7768c2d6e5f6dad2d 100644 (file)
@@ -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;