From 87bd1f4d0283ef35f3cd1316ee66750598f05bd2 Mon Sep 17 00:00:00 2001 From: Christian Stocker Date: Wed, 10 Dec 2003 22:32:36 +0000 Subject: fix crashes when you call php:functionString() with a non-string handler (by adam) --- ext/xsl/php_xsl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext/xsl/php_xsl.c') 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); -- cgit v1.2.1