Validate "parser" and "s" parameters to XML_Parse

This commit is contained in:
Rhodri James 2017-04-25 18:10:58 +01:00 committed by Sebastian Pipping
parent b58abe1e92
commit 56c75720c2

View file

@ -1647,6 +1647,12 @@ XML_SetHashSalt(XML_Parser parser,
enum XML_Status XMLCALL
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
{
if (parser == NULL)
return XML_STATUS_ERROR;
if (s == NULL && len != 0) {
errorCode = XML_ERROR_INVALID_ARGUMENT;
return XML_STATUS_ERROR;
}
switch (ps_parsing) {
case XML_SUSPENDED:
errorCode = XML_ERROR_SUSPENDED;