From b070843f5bd910534c757db9633e2542632bfa6e Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 24 May 2017 20:52:16 +0200 Subject: [PATCH] Make XML_GetInputContext parameter validation more flexible --- expat/lib/xmlparse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 3ff3b48b..f773799d 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -2045,11 +2045,13 @@ const char * XMLCALL XML_GetInputContext(XML_Parser parser, int *offset, int *size) { #ifdef XML_CONTEXT_BYTES - if (parser == NULL || offset == NULL || size == NULL) + if (parser == NULL) return NULL; if (eventPtr && buffer) { - *offset = (int)(eventPtr - buffer); - *size = (int)(bufferEnd - buffer); + if (offset != NULL) + *offset = (int)(eventPtr - buffer); + if (size != NULL) + *size = (int)(bufferEnd - buffer); return buffer; } #endif /* defined XML_CONTEXT_BYTES */ -- 2.40.0