blob: 11da9f9bd9a19de1e61412670153eea53b627d7d [file] [log] [blame]
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001From a7dfab7411cbf545f359dd3157e5df1eb0e7ce31 Mon Sep 17 00:00:00 2001
2From: Daniel Veillard <veillard@redhat.com>
3Date: Mon, 23 Feb 2015 11:17:35 +0800
4Subject: [PATCH] Stop parsing on entities boundaries errors
5
6For https://bugzilla.gnome.org/show_bug.cgi?id=744980
7
8There are times, like on unterminated entities that it's preferable to
9stop parsing, even if that means less error reporting. Entities are
10feeding the parser on further processing, and if they are ill defined
11then it's possible to get the parser to bug. Also do the same on
12Conditional Sections if the input is broken, as the structure of
13the document can't be guessed.
14
15Upstream-Status: Backport
16
17CVE-2015-7941-1
18
19Signed-off-by: Armin Kuster <akuster@mvista.com>
20
21---
22 parser.c | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/parser.c b/parser.c
26index a8d1b67..bbe97eb 100644
27--- a/parser.c
28+++ b/parser.c
29@@ -5658,6 +5658,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
30 if (RAW != '>') {
31 xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
32 "xmlParseEntityDecl: entity %s not terminated\n", name);
33+ xmlStopParser(ctxt);
34 } else {
35 if (input != ctxt->input) {
36 xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
37--
382.3.5
39