summaryrefslogtreecommitdiff
path: root/libexslt
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-08-16 15:51:35 +0800
committerDaniel Veillard <veillard@redhat.com>2012-08-16 15:51:35 +0800
commit24653072221e76d2f1f06aa71225229b532f8946 (patch)
tree12cfeb41cd6052126b8325a087eb7e77e89042bb /libexslt
parenta2cd8a03ac2ae0b46b51320f6f56f09c23880d7a (diff)
downloadlibxslt-24653072221e76d2f1f06aa71225229b532f8946.tar.gz
libxslt-24653072221e76d2f1f06aa71225229b532f8946.tar.bz2
libxslt-24653072221e76d2f1f06aa71225229b532f8946.zip
Hardening of code checking node types in EXSLT
Diffstat (limited to 'libexslt')
-rw-r--r--libexslt/functions.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libexslt/functions.c b/libexslt/functions.c
index 13fd06ee..4c68cea9 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
*/