summaryrefslogtreecommitdiff
path: root/ext/xsl
diff options
context:
space:
mode:
authorChristian Stocker <chregu@php.net>2003-12-10 22:32:36 +0000
committerChristian Stocker <chregu@php.net>2003-12-10 22:32:36 +0000
commit87bd1f4d0283ef35f3cd1316ee66750598f05bd2 (patch)
tree680534e36bc0a3df35f1dc08d083da3d986f0a73 /ext/xsl
parent56f046a67a9b531af23794bb577b0307631a46bf (diff)
downloadphp-git-87bd1f4d0283ef35f3cd1316ee66750598f05bd2.tar.gz
fix crashes when you call php:functionString() with a
non-string handler (by adam)
Diffstat (limited to 'ext/xsl')
-rw-r--r--ext/xsl/php_xsl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 917bfb2d57..a58d90730d 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -247,6 +247,16 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
fci.function_table = EG(function_table);
obj = valuePop(ctxt);
+ if (obj->stringval == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
+ xmlXPathFreeObject(obj);
+ for (i = 0; i < nargs - 1; i++) {
+ zval_ptr_dtor(&args[i]);
+ }
+ efree(args);
+ efree(fci.params);
+ return;
+ }
INIT_PZVAL(&handler);
ZVAL_STRING(&handler, obj->stringval, 1);
xmlXPathFreeObject(obj);