From bc0cf14fbd1df0acde2c437a6a00f3c1e7c9c24e Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 25 Apr 2017 15:49:05 +0100 Subject: [PATCH] Validate parser parameter to XML_SetEncoding --- expat/lib/xmlparse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 642cd6aa..2f5f5573 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -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. -- 2.40.0