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
This commit is contained in:
Albrecht Schlosser 2019-04-04 17:20:57 +02:00
parent 7a3af40ede
commit 42afc70b6a
1 changed files with 2 additions and 0 deletions

View File

@ -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;