Validate "parser" and "s" parameters to XML_Parse
@@ -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;
