summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-05 19:31:59 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-05 19:31:59 +0100
commitb426a3d7c07c9ffd53141ebd03dcd5e82ff4e52a (patch)
tree78dec22c39ad45850d93a7eefcfa5fb8cdb7074b /src
parent918395e0916a6ae48663b41173f5c0d887dcc347 (diff)
Fix two rare potential bugs (NULL pointer dereferencing)
Both bugs can happen if a widget doesn't have an associated window() or in similar situations. These fixes returns NULL to prevent crashes. Bugs observed in special test scenarios, not real-life programs.
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index d3df1494b..3b1e7bbf8 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -980,6 +980,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
Fl_Wayland_Screen_Driver::output *output;
wait_for_expose_value = 1;
+ if (pWindow->parent() && !pWindow->window()) return NULL;
if (pWindow->parent() && !pWindow->window()->shown()) return NULL;
new_window = (struct wld_window *)calloc(1, sizeof *new_window);