Skip to content

Commit 1890d47

Browse files
authored
Fix missing deref in C14N (#14203)
Follow-up for 30a0b03, which didn't fix all places. This is the last remaining place.
1 parent 239003e commit 1890d47

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ext/dom/node.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
16671667
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
16681668
sizeof(xmlChar *), 0);
16691669
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
1670+
ZVAL_DEREF(tmpns);
16701671
if (Z_TYPE_P(tmpns) == IS_STRING) {
16711672
inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
16721673
}

ext/dom/tests/DOMNode_C14N_references.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ unset($v);
3838
echo $doc->C14N(true, false, $xpath, $prefixes);
3939
?>
4040
--EXPECT--
41-
<contain xmlns="http://www.example.com/ns/foo"><bar></bar><bar></bar></contain>
41+
<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test"><bar></bar><bar></bar></contain>

0 commit comments

Comments
 (0)