From: Jaroslav Kysela Date: Fri, 22 Jun 2018 08:26:22 +0000 (+0200) Subject: htsmsg xml parser: fix NULL oops, fixes #5135 X-Git-Tag: v4.2.7~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12bff89b47c0b6536c838be11a2cbd10861a7dbf;p=thirdparty%2Ftvheadend.git htsmsg xml parser: fix NULL oops, fixes #5135 --- diff --git a/src/htsmsg_xml.c b/src/htsmsg_xml.c index c9edc1a0e..f1d6a0719 100644 --- a/src/htsmsg_xml.c +++ b/src/htsmsg_xml.c @@ -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++;