]> granicus.if.org Git - libexpat/commitdiff
Validate parser parameter to XML_MemRealloc
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 25 Apr 2017 17:45:39 +0000 (18:45 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Wed, 24 May 2017 18:49:40 +0000 (20:49 +0200)
expat/lib/xmlparse.c

index ac604f58c0f6768a3fa3148c89c2f453fd60694f..95e48fc1468fc9a63c622de8c1f7c637202ae838 100644 (file)
@@ -2098,6 +2098,8 @@ XML_MemMalloc(XML_Parser parser, size_t size)
 void * XMLCALL
 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
 {
+  if (parser == NULL)
+    return NULL;
   return REALLOC(ptr, size);
 }