From: Jaroslav Kysela Date: Fri, 22 Jun 2018 08:26:22 +0000 (+0200) Subject: htsmsg xml parser: fix NULL oops, fixes #5135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66d6161c563181e5a572337ab3509a835c5a57e2;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 7a27b44bb..4123e74d6 100644 --- a/src/htsmsg_xml.c +++ b/src/htsmsg_xml.c @@ -424,7 +424,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; } @@ -763,9 +763,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++;