Handle unterminated comment in XML parser (#270)

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-11-04 11:06:32 +01:00 committed by eboasson
parent d545551a60
commit 5883b96f6a

View file

@ -500,7 +500,7 @@ static int skip_comment (struct ddsrt_xmlp_state *st)
if (!peek_chars (st, "<!--", 1)) { if (!peek_chars (st, "<!--", 1)) {
return 0; return 0;
} }
while ((peek_char (st) != TOK_EOF && peek_char (st) != '-') || !peek_chars (st, "-->", 0)) { while (peek_char (st) != TOK_EOF && (peek_char (st) != '-' || !peek_chars (st, "-->", 0))) {
next_char (st); next_char (st);
} }
if (peek_chars (st, "-->", 1)) { if (peek_chars (st, "-->", 1)) {