diff options
Diffstat (limited to 'src/kernel/window.c')
-rw-r--r-- | src/kernel/window.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel/window.c b/src/kernel/window.c index 4b01bc4..69babe4 100644 --- a/src/kernel/window.c +++ b/src/kernel/window.c @@ -330,9 +330,15 @@ got_window: } static void del_no_paint(struct window *w) { + if ((w < windows) || (w >= windows + MAX_WINDOWS) || (((void *)w - (void *)windows) % sizeof(struct window))) { + logf(LOG_WARN, "Refusing to delete bad window pointer 0x%h", w); + return; + } + if (w == top_window) { top_window = w->below; - send_action(top_window, (struct window_action){.action_type = FOCUS_ENTER}); + if (top_window) + send_action(top_window, (struct window_action){.action_type = FOCUS_ENTER}); } if (w == bottom_window) bottom_window = w->above; |