summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-02-11 19:01:48 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-02-11 19:01:48 +0100
commitc4ed2341ecc29bd7a49e9e369d53dc25fc415030 (patch)
treeea3f6b803ebefd6b711636505b80b8088748a4a0
parent6db64404414cbf42a37e6c137532272d9544ff11 (diff)
Fix potential null pointer dereferences in fluid
-rw-r--r--fluid/Fl_Widget_Type.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 655aa7257..ca344170a 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -259,7 +259,8 @@ void Fl_Widget_Type::redraw() {
// find the menu button that parents this menu:
do t = t->parent; while (t && t->is_menu_item());
// kludge to cause build_menu to be called again:
- t->add_child(0,0);
+ if (t)
+ t->add_child(0, 0);
} else {
while (t->parent && t->parent->is_widget()) t = t->parent;
((Fl_Widget_Type*)t)->o->redraw();
@@ -638,6 +639,8 @@ const char *item_name(Fl_Menu_Item* m, int i) {
return buffer;
}
int item_number(Fl_Menu_Item* m, const char* i) {
+ if (!i)
+ return 0;
if (m && i) {
if (i[0]=='F' && i[1]=='L' && i[2]=='_') i += 3;
while (m->label()) {