]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsmsg xml parser: fix NULL oops, fixes #5135
authorJaroslav Kysela <perex@perex.cz>
Fri, 22 Jun 2018 08:26:22 +0000 (10:26 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 22 Jun 2018 08:30:55 +0000 (10:30 +0200)
src/htsmsg_xml.c

index c9edc1a0e16e10bfefecc639d1a22d5385103b42..f1d6a0719e2f79f084c65ee446ec320803dffa24 100644 (file)
@@ -427,7 +427,7 @@ htsmsg_xml_parse_pi(xmlparser_t *xp, htsmsg_t *parent, char *src)
   while(1) {
     if(*src == 0) {
       xmlerr(xp, "Unexpected end of file during parsing of "
-            "Processing instructions");
+                "Processing instructions");
       return NULL;
     }
 
@@ -768,9 +768,7 @@ htsmsg_parse_prolog(xmlparser_t *xp, char *src)
   htsmsg_t *xmlpi;
   const char *encoding;
 
-  while(1) {
-    if(*src == 0)
-      break;
+  while(src != NULL && *src != 0) {
 
     while(is_xmlws(*src))
       src++;