diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index c3df6ce6..571918d4 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -2034,6 +2034,8 @@ XML_GetCurrentByteIndex(XML_Parser parser) int XMLCALL XML_GetCurrentByteCount(XML_Parser parser) { + if (parser == NULL) + return 0; if (eventEndPtr && eventPtr) return (int)(eventEndPtr - eventPtr); return 0;