Fix trampoline leak in xpath callables

Closes GH-15009.
This commit is contained in:
Niels Dossche 2024-07-18 15:17:42 +02:00
parent 5471f3d922
commit a59103feed
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
5 changed files with 54 additions and 4 deletions

View file

@ -707,11 +707,12 @@ PHP_METHOD(XSLTProcessor, registerPHPFunctionNS)
ZEND_PARSE_PARAMETERS_END();
if (zend_string_equals_literal(namespace, "http://php.net/xsl")) {
zend_release_fcall_info_cache(&fcc);
zend_argument_value_error(1, "must not be \"http://php.net/xsl\" because it is reserved by PHP");
RETURN_THROWS();
}
php_dom_xpath_callbacks_update_single_method_handler(
if (php_dom_xpath_callbacks_update_single_method_handler(
&intern->xpath_callbacks,
NULL,
namespace,
@ -719,7 +720,9 @@ PHP_METHOD(XSLTProcessor, registerPHPFunctionNS)
&fcc,
PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME,
NULL
);
) != SUCCESS) {
zend_release_fcall_info_cache(&fcc);
}
}
/* {{{ */