lib/xmlparse.c: Reject directly recursive parameter entities
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index b884d82..8e667fc 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -6240,7 +6240,7 @@
           dtd->keepProcessing = dtd->standalone;
           goto endEntityValue;
         }
-        if (entity->open) {
+        if (entity->open || (entity == parser->m_declEntity)) {
           if (enc == parser->m_encoding)
             parser->m_eventPtr = entityTextPtr;
           result = XML_ERROR_RECURSIVE_ENTITY_REF;