summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2019-04-04 17:20:57 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2019-04-04 17:20:57 +0200
commit42afc70b6a41f32d4e70cea8dfe3e9b1bb9789f6 (patch)
tree36ad185dd6741828ec0b0695856b12aad6655114 /fluid
parent7a3af40ede5cbd325775eb4ffdef9ff28bcad191 (diff)
Fix potential crash in fluid (issue #14)
trimclassname() would crash if it was given a NULL pointer. Now a NULL pointer is returned instead. Fixes #14
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Window_Type.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index e0c8bc0c4..ac1f4dca2 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -1479,6 +1479,8 @@ void Fl_Widget_Class_Type::read_property(const char *c) {
// Convert A::B::C::D to D (i.e. keep only innermost name)
// This is useful for classes that contain a namespace component
static const char *trimclassname(const char *n) {
+ if (!n)
+ return NULL;
const char *nn;
while((nn = strstr(n, "::"))) {
n = nn + 2;