[libxslt] Hardening of code checking node types in EXSLT



commit 24653072221e76d2f1f06aa71225229b532f8946
Author: Daniel Veillard <veillard redhat com>
Date:   Thu Aug 16 15:51:35 2012 +0800

    Hardening of code checking node types in EXSLT

 libexslt/functions.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
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
      */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]