blob: e4d09c2ac765e312fca899bcd73fd3c0e7bb6231 [file] [log] [blame]
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001From 7ca19df892ca22d9314e95d59ce2abdeff46b617 Mon Sep 17 00:00:00 2001
2From: Daniel Veillard <veillard@redhat.com>
3Date: Thu, 29 Oct 2015 19:33:23 +0800
4Subject: Fix for type confusion in preprocessing attributes
5
6CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
7We need to check that the parent node is an element before dereferencing
8its namespace
9
10Upstream-Status: Backport
11
12https://git.gnome.org/browse/libxslt/commit/?id=7ca19df892ca22d9314e95d59ce2abdeff46b617
13
14Signed-off-by: Armin Kuster <akuster@mvista.com>
15
16---
17 libxslt/preproc.c | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20Index: libxslt-1.1.28/libxslt/preproc.c
21===================================================================
22--- libxslt-1.1.28.orig/libxslt/preproc.c
23+++ libxslt-1.1.28/libxslt/preproc.c
24@@ -2245,7 +2245,8 @@ xsltStylePreCompute(xsltStylesheetPtr st
25 } else if (IS_XSLT_NAME(inst, "attribute")) {
26 xmlNodePtr parent = inst->parent;
27
28- if ((parent == NULL) || (parent->ns == NULL) ||
29+ if ((parent == NULL) ||
30+ (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) ||
31 ((parent->ns != inst->ns) &&
32 (!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
33 (!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) {