]> granicus.if.org Git - libexpat/commitdiff
Fix for #137: check parse status before epilogue processing.
authorRhodri James <rhodri@kynesim.co.uk>
Thu, 31 Aug 2017 12:11:26 +0000 (13:11 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 2 Sep 2017 20:32:48 +0000 (22:32 +0200)
This is just a sticking plaster; the parse status handling is
currently being reconsidered for more general refactoring.

expat/lib/xmlparse.c

index 1af1e8dbfd9fc737d813e467f060811dd548fccf..c50baa66109e3b533c1b58f892f93c83e10c11a4 100644 (file)
@@ -2959,8 +2959,10 @@ doContent(XML_Parser parser,
         poolClear(&tempPool);
         freeBindings(parser, bindings);
       }
-      if (tagLevel == 0)
+      if ((tagLevel == 0) &&
+          !((ps_parsing == XML_FINISHED) || (ps_parsing == XML_SUSPENDED))) {
         return epilogProcessor(parser, next, end, nextPtr);
+      }
       break;
     case XML_TOK_END_TAG:
       if (tagLevel == startTagLevel)