diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 2de26ba2..40590e7f 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -1476,6 +1476,8 @@ XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end) { + if (parser == NULL) + return; startDoctypeDeclHandler = start; endDoctypeDeclHandler = end; }