diff options
Diffstat (limited to 'meta/recipes-core/libxml/libxml2/CVE-2015-7499-2-Detect-incoherency-on-GROW.patch')
-rw-r--r-- | meta/recipes-core/libxml/libxml2/CVE-2015-7499-2-Detect-incoherency-on-GROW.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2015-7499-2-Detect-incoherency-on-GROW.patch b/meta/recipes-core/libxml/libxml2/CVE-2015-7499-2-Detect-incoherency-on-GROW.patch new file mode 100644 index 0000000000..aff3920953 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/CVE-2015-7499-2-Detect-incoherency-on-GROW.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 35bcb1d758ed70aa7b257c9c3b3ff55e54e3d0da Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Veillard <veillard@redhat.com> | ||
3 | Date: Fri, 20 Nov 2015 15:04:09 +0800 | ||
4 | Subject: [PATCH] Detect incoherency on GROW | ||
5 | |||
6 | the current pointer to the input has to be between the base and end | ||
7 | if not stop everything we have an internal state error. | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | CVE-2015-7499-2 | ||
12 | |||
13 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
14 | |||
15 | --- | ||
16 | parser.c | 9 ++++++++- | ||
17 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/parser.c b/parser.c | ||
20 | index 1810f99..ab007aa 100644 | ||
21 | --- a/parser.c | ||
22 | +++ b/parser.c | ||
23 | @@ -2075,9 +2075,16 @@ static void xmlGROW (xmlParserCtxtPtr ctxt) { | ||
24 | ((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) && | ||
25 | ((ctxt->options & XML_PARSE_HUGE) == 0)) { | ||
26 | xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup"); | ||
27 | - ctxt->instate = XML_PARSER_EOF; | ||
28 | + xmlHaltParser(ctxt); | ||
29 | + return; | ||
30 | } | ||
31 | xmlParserInputGrow(ctxt->input, INPUT_CHUNK); | ||
32 | + if ((ctxt->input->cur > ctxt->input->end) || | ||
33 | + (ctxt->input->cur < ctxt->input->base)) { | ||
34 | + xmlHaltParser(ctxt); | ||
35 | + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "cur index out of bound"); | ||
36 | + return; | ||
37 | + } | ||
38 | if ((ctxt->input->cur != NULL) && (*ctxt->input->cur == 0) && | ||
39 | (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) | ||
40 | xmlPopInput(ctxt); | ||
41 | -- | ||
42 | 2.3.5 | ||
43 | |||