summaryrefslogtreecommitdiff
path: root/ext/xsl/xsltprocessor.c
diff options
context:
space:
mode:
authorkusano <kusano@users.noreply.github.com>2016-02-17 01:00:58 +0900
committerkusano <kusano@users.noreply.github.com>2016-02-17 01:00:58 +0900
commit07cae46b02795f8364d28ecad6ec45f507e7114b (patch)
tree47795fa54a8cf014e918d8bfe3056e9b30ec9b0e /ext/xsl/xsltprocessor.c
parentd31e8a9a85efea54db0b647424f6c4485d71db8b (diff)
parent3244d3c7e936b23ad33892e367500f64468c6140 (diff)
downloadphp-git-07cae46b02795f8364d28ecad6ec45f507e7114b.tar.gz
Merge branch 'master' into fix-mt_rand
Conflicts: ext/standard/rand.c
Diffstat (limited to 'ext/xsl/xsltprocessor.c')
-rw-r--r--ext/xsl/xsltprocessor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index acba075340..600c7cddb0 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
+ | Copyright (c) 1997-2016 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -231,6 +231,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
/* Reverse order to pop values off ctxt stack */
for (i = nargs - 2; i >= 0; i--) {
obj = valuePop(ctxt);
+ if (obj == NULL) {
+ ZVAL_NULL(&args[i]);
+ continue;
+ }
switch (obj->type) {
case XPATH_STRING:
ZVAL_STRING(&args[i], (char *)obj->stringval);
@@ -300,7 +304,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
obj = valuePop(ctxt);
- if (obj->stringval == NULL) {
+ if (obj == NULL || obj->stringval == NULL) {
php_error_docref(NULL, E_WARNING, "Handler name must be a string");
xmlXPathFreeObject(obj);
valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));