]> granicus.if.org Git - libexpat/commitdiff
xmlparse.c: Fix effect of XML_StopParser for end element handlers (#240)
authorSebastian Pipping <sebastian@pipping.org>
Wed, 31 Jul 2019 18:15:38 +0000 (20:15 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 4 Aug 2019 13:15:27 +0000 (15:15 +0200)
expat/lib/xmlparse.c

index a3390fbfc6bbd0c6738feab17860e5ab16bfdb10..e89a2afddacb30511088dc03bf41c85c62c9b2d8 100644 (file)
@@ -2853,8 +2853,13 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
           parser->m_freeBindingList = b;
           b->prefix->binding = b->prevPrefixBinding;
         }
-        if (parser->m_tagLevel == 0)
-          return epilogProcessor(parser, next, end, nextPtr);
+        if ((parser->m_tagLevel == 0)
+            && (parser->m_parsingStatus.parsing != XML_FINISHED)) {
+          if (parser->m_parsingStatus.parsing == XML_SUSPENDED)
+            parser->m_processor = epilogProcessor;
+          else
+            return epilogProcessor(parser, next, end, nextPtr);
+        }
       }
       break;
     case XML_TOK_CHAR_REF: {