components/libxslt/patches/09-libxslt-Hardening-of-code-checking-node-types-in-EXSLT.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Tue, 01 Apr 2014 01:43:14 -0700
branchs11u1-sru
changeset 3035 8420a12f63ef
parent 2471 b1f0e4a84df6
permissions -rw-r--r--
18490686 Upgrade Wireshark to version 1.8.13 (for 11.1SRU) 18384235 problem in UTILITY/WIRESHARK

Taken as it's from:

http://git.gnome.org/browse/libxslt/commit/?id=24653072221e76d2f1f06aa71225229b532f8946

Followup on CVE-2012-2870

From 24653072221e76d2f1f06aa71225229b532f8946 Mon Sep 17 00:00:00 2001
From: Daniel Veillard <[email protected]>
Date: Thu, 16 Aug 2012 07:51:35 +0000
Subject: Hardening of code checking node types in EXSLT

---
diff --git a/libexslt/functions.c b/libexslt/functions.c
index 13fd06e..4c68cea 100644
--- a/libexslt/functions.c
+++ b/libexslt/functions.c
@@ -459,10 +459,9 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
     xmlHashTablePtr data;
     exsltFuncFunctionData *func;
 
-    if ((style == NULL) || (inst == NULL))
+    if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
 	return;
 
-
     {
 	xmlChar *qname;
 
@@ -546,6 +545,9 @@ exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
     xmlChar *sel;
     exsltFuncResultPreComp *ret;
 
+    if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
+        return (NULL);
+
     /*
      * "Validity" checking
      */
--
cgit v0.9.0.2