1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  Fix missing deref in C14N (#14203)
This commit is contained in:
Niels Dossche
2024-05-11 17:13:20 +02:00
2 changed files with 2 additions and 1 deletions

View File

@@ -2184,6 +2184,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
sizeof(xmlChar *), 0);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
ZVAL_DEREF(tmpns);
if (Z_TYPE_P(tmpns) == IS_STRING) {
inclusive_ns_prefixes[nscount++] = BAD_CAST Z_STRVAL_P(tmpns);
}

View File

@@ -38,4 +38,4 @@ unset($v);
echo $doc->C14N(true, false, $xpath, $prefixes);
?>
--EXPECT--
<contain xmlns="http://www.example.com/ns/foo"><bar></bar><bar></bar></contain>
<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test"><bar></bar><bar></bar></contain>