From: Sebastian Pipping Date: Sat, 1 Jul 2017 12:33:57 +0000 (+0200) Subject: xmlparse.c: Fix parser NULL dereference X-Git-Tag: R_2_2_2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe;p=libexpat xmlparse.c: Fix parser NULL dereference errorCode is a macro resolving to parser->m_errorCode. Issue #59 is related. --- diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 66a7f35e..d38c90db 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -1748,7 +1748,8 @@ enum XML_Status XMLCALL XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { if ((parser == NULL) || (len < 0) || ((s == NULL) && (len != 0))) { - errorCode = XML_ERROR_INVALID_ARGUMENT; + if (parser != NULL) + parser->m_errorCode = XML_ERROR_INVALID_ARGUMENT; return XML_STATUS_ERROR; } switch (ps_parsing) {