samiparse : fix svace issue
authorHyunil <hyunil46.park@samsung.com>
Tue, 12 Sep 2017 02:57:09 +0000 (11:57 +0900)
committerHyunil <hyunil46.park@samsung.com>
Wed, 13 Sep 2017 04:44:17 +0000 (13:44 +0900)
Change-Id: I58b4a5a880fb30e7498c9d9465de216dba136039
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
gst/subparse/samiparse.c

index 898028d..0fa3841 100644 (file)
@@ -659,12 +659,14 @@ html_context_handle_element (HtmlContext * ctxt,
         name_temp--;
       }
       name_temp++;
-      for (j = 0; *(name_temp + j) != ' '; j++) {
-        attr_name[j] = *(name_temp + j);
+      if (attr_name != NULL) {
+        for (j = 0; *(name_temp + j) != ' '; j++) {
+          attr_name[j] = *(name_temp + j);
+        }
+        attr_name[j] = '\0';
+        attrs[attrindex++] = attr_name;
+        attrs[attrindex++] = attr_value;
       }
-      attr_name[j] = '\0';
-      attrs[attrindex++] = attr_name;
-      attrs[attrindex++] = attr_value;
     }
   } else {
     count = 0;