From d53d6f3bcefc3e7f42cdf4920d24dc851aa63b00 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 10 Feb 2021 14:11:04 +0100 Subject: Fix potential NULL pointer dereference --- src/Fl_Window.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index f489fe89a..26e259b5d 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -135,7 +135,7 @@ Fl_Window* Fl_Widget::top_window_offset(int& xoff, int& yoff) const { yoff += w->y(); w = w->window(); // walk up window hierarchy } - return const_cast(w)->as_window(); + return w ? const_cast(w)->as_window() : NULL; } /** Gets the x position of the window on the screen */ -- cgit v1.2.3