From 5fcf57739e68a8b5053e03778aaee0eed445babd Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Thu, 11 Mar 2021 22:00:22 -0500 Subject: settings editor, and lots of changes in service of that --- src/kernel/window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/kernel/window.c') 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; -- cgit v1.2.3