Validate parameters to XML_GetInputContext

This commit is contained in:
Rhodri James 2017-04-25 18:32:34 +01:00 committed by Sebastian Pipping
parent fd2571b27a
commit 88731abd62

View File

@ -2045,6 +2045,8 @@ const char * XMLCALL
XML_GetInputContext(XML_Parser parser, int *offset, int *size)
{
#ifdef XML_CONTEXT_BYTES
if (parser == NULL || offset == NULL || size == NULL)
return NULL;
if (eventPtr && buffer) {
*offset = (int)(eventPtr - buffer);
*size = (int)(bufferEnd - buffer);