svg_loader: additional check while style parsing 15/289015/1
authorMira Grudzinska <m.grudzinska@samsung.com>
Mon, 17 Jan 2022 21:32:19 +0000 (22:32 +0100)
committerMichal Szczecinski <mihashco89@gmail.com>
Mon, 27 Feb 2023 08:46:19 +0000 (09:46 +0100)
This check is needed so the function can be used to parse
not only the inline styles, but also the css internal style sheet.

Change-Id: I6e325d81781326deaccdad8170f11f1acf5f43f2

src/loaders/svg/tvgXmlParser.cpp

index 4b54e06..20fd85c 100644 (file)
@@ -468,6 +468,13 @@ bool simpleXmlParseW3CAttribute(const char* buf, TVG_UNUSED unsigned buflen, sim
     do {
         char* sep = (char*)strchr(buf, ':');
         next = (char*)strchr(buf, ';');
+        if (sep >= end)
+        {
+            next = nullptr;
+            sep = nullptr;
+        }
+        if (next >= end) next = nullptr;
+
 
         key[0] = '\0';
         val[0] = '\0';