From: Marcus Meissner <meissner@suse.de>
Date: Wed, 3 Jan 2018 14:43:41 +0100
Subject: Out-of-bounds read in htmlParseTryOrFinish

Origin: vendor, https://bugzilla.novell.com/attachment.cgi?id=732309
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775200
Bug-Debian: https://bugs.debian.org/862450
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-8872
Bug-SUSE: https://bugzilla.novell.com/show_bug.cgi?id=1038444
Forwarded: yes, https://bugzilla.gnome.org/attachment.cgi?id=366193
Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2018-01-03
---
 parser.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/parser.c b/parser.c
index 1c5e036..0251110 100644
--- a/parser.c
+++ b/parser.c
@@ -12467,6 +12467,10 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
 	ctxt->input->cur = BAD_CAST"";
 	ctxt->input->base = ctxt->input->cur;
         ctxt->input->end = ctxt->input->cur;
+    if (ctxt->input->buf)
+        xmlBufEmpty (ctxt->input->buf->buffer);
+    else
+        ctxt->input->length = 0;
     }
 }
 
