Skip to content

Commit

Permalink
Fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
... as reported in thread "Windows 11 crash (still investigating)"
of fltk.coredev, started on Apr 24, 2024.

This bug could only be triggered if a /subwindow/ wss hidden but was
not limited to Windows.
  • Loading branch information
Albrecht Schlosser committed Apr 29, 2024
1 parent 8664fde commit b402b6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Fl_Window.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,9 @@ int Fl_Window::handle(int ev)
// unmap because when the parent window is remapped we don't
// want to reappear.
if (visible()) {
Fl_Widget* p = parent(); for (;p->visible();p = p->parent()) {}
if (p->type() >= FL_WINDOW) break; // don't do the unmap
Fl_Widget* p = parent();
for (; p && p->visible(); p = p->parent()) { /* empty*/ }
if (p && p->as_window()) break; // don't do the unmap
}
pWindowDriver->unmap();
}
Expand Down

0 comments on commit b402b6a

Please sign in to comment.