Validate parser parameter to XML_SetEncoding
@@ -1014,6 +1014,8 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
enum XML_Status XMLCALL
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
{
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
/* Block after XML_Parse()/XML_ParseBuffer() has been called.
XXX There's no way for the caller to determine which of the
XXX possible error cases caused the XML_STATUS_ERROR return.
