From fd2571b27a1b953315b439d82ccb40a263d249f2 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 25 Apr 2017 18:30:29 +0100 Subject: [PATCH] Validate parser parameter to XML_GetCurrentByteCount --- expat/lib/xmlparse.c | 2 ++ 1 file changed, 2 insertions(+) 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;