From efa611caf2d45851a42274a922bc8a8f82ae0a19 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 31 May 2018 14:25:13 +0200 Subject: Prevent seg fault if value is null. --- src/object/sp-tspan.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/object/sp-tspan.cpp') diff --git a/src/object/sp-tspan.cpp b/src/object/sp-tspan.cpp index 9aee85d39..175e5da3f 100644 --- a/src/object/sp-tspan.cpp +++ b/src/object/sp-tspan.cpp @@ -283,6 +283,7 @@ void SPTextPath::release() { } void SPTextPath::set(unsigned int key, const gchar* value) { + if (this->attributes.readSingleAttribute(key, value, style, &viewport)) { this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } else { @@ -291,6 +292,10 @@ void SPTextPath::set(unsigned int key, const gchar* value) { this->sourcePath->link((char*)value); break; case SP_ATTR_SIDE: + if (!value) { + return; + } + if (strncmp(value, "left", 4) == 0) side = SP_TEXT_PATH_SIDE_LEFT; else if (strncmp(value, "right", 5) == 0) -- cgit v1.2.3