From 12bff89b47c0b6536c838be11a2cbd10861a7dbf Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 22 Jun 2018 10:26:22 +0200 Subject: [PATCH] htsmsg xml parser: fix NULL oops, fixes #5135 --- src/htsmsg_xml.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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++; -- 2.47.2