Validate parser parameter to XML_GetCurrentByteCount

This commit is contained in:
Rhodri James 2017-04-25 18:30:29 +01:00 committed by Sebastian Pipping
parent 2253c12304
commit fd2571b27a

View File

@ -2034,6 +2034,8 @@ XML_GetCurrentByteIndex(XML_Parser parser)
int XMLCALL int XMLCALL
XML_GetCurrentByteCount(XML_Parser parser) XML_GetCurrentByteCount(XML_Parser parser)
{ {
if (parser == NULL)
return 0;
if (eventEndPtr && eventPtr) if (eventEndPtr && eventPtr)
return (int)(eventEndPtr - eventPtr); return (int)(eventEndPtr - eventPtr);
return 0; return 0;