]> granicus.if.org Git - libexpat/commitdiff
Validate parser parameter to XML_SetXmlDeclHandler
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 25 Apr 2017 16:52:04 +0000 (17:52 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Wed, 24 May 2017 18:49:40 +0000 (20:49 +0200)
expat/lib/xmlparse.c

index 27accb2218e3285d4ee5c191e42ecabe87899cf4..3125c671db8560b77db773f751db65c914d6a275 100644 (file)
@@ -1610,7 +1610,8 @@ XML_SetEntityDeclHandler(XML_Parser parser,
 void XMLCALL
 XML_SetXmlDeclHandler(XML_Parser parser,
                       XML_XmlDeclHandler handler) {
-  xmlDeclHandler = handler;
+  if (parser != NULL)
+    xmlDeclHandler = handler;
 }
 
 int XMLCALL