aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch
blob: b34479f318fedad5735f6185a1c52bcb7f070521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From b4bee17b158e289e5c4c9045e64e5374ccafe068 Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Tue, 3 Jul 2018 15:54:03 +0800
Subject: [PATCH] Out-of-bounds read in htmlParseTryOrFinish (CVE-2017-8872)

https://bugzilla.gnome.org/show_bug.cgi?id=775200
Fixes bug 775200.

Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>

Upstream-Status: Submitted
https://bug775200.bugzilla-attachments.gnome.org/attachment.cgi?id=366193
CVE: CVE-2017-8872
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 parser.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/parser.c b/parser.c
index ca9fde2..fb4c889 100644
--- a/parser.c
+++ b/parser.c
@@ -12464,7 +12464,11 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
 	}
 	ctxt->input->cur = BAD_CAST"";
 	ctxt->input->base = ctxt->input->cur;
-        ctxt->input->end = ctxt->input->cur;
+	ctxt->input->end = ctxt->input->cur;
+	if (ctxt->input->buf)
+	    xmlBufEmpty (ctxt->input->buf->buffer);
+	else
+	    ctxt->input->length = 0;
     }
 }
 
-- 
2.7.4