Validate parser parameter for XML_ParseBuffer
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index 991a527..62cd1d6 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -1782,6 +1782,8 @@
   const char *start;
   enum XML_Status result = XML_STATUS_OK;
 
+  if (parser == NULL)
+    return XML_STATUS_ERROR;
   switch (ps_parsing) {
   case XML_SUSPENDED:
     errorCode = XML_ERROR_SUSPENDED;