aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libxml/xpathInternals.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index dcd52434..a1944ae1 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -296,7 +296,9 @@ XMLPUBFUN void * XMLCALL
#define CHECK_ARITY(x) \
if (ctxt == NULL) return; \
if (nargs != (x)) \
- XP_ERROR(XPATH_INVALID_ARITY);
+ XP_ERROR(XPATH_INVALID_ARITY); \
+ if (ctxt->valueNr < ctxt->valueFrame + (x)) \
+ XP_ERROR(XPATH_STACK_ERROR);
/**
* CAST_TO_STRING: