xmlparse.c: Fix external entity infinite loop bug (CVE-2017-9233)

This commit is contained in:
Rhodri James 2017-06-14 23:45:07 +02:00 committed by Sebastian Pipping
parent 774ee6c15b
commit c4bf96bb51

View File

@ -3981,6 +3981,14 @@ entityValueInitProcessor(XML_Parser parser,
*nextPtr = next;
return XML_ERROR_NONE;
}
/* If we get this token, we have the start of what might be a
normal tag, but not a declaration (i.e. it doesn't begin with
"<!"). In a DTD context, that isn't legal.
*/
else if (tok == XML_TOK_INSTANCE_START) {
*nextPtr = next;
return XML_ERROR_SYNTAX;
}
start = next;
eventPtr = start;
}