From 42afc70b6a41f32d4e70cea8dfe3e9b1bb9789f6 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 4 Apr 2019 17:20:57 +0200 Subject: 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 --- fluid/Fl_Window_Type.cxx | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3