Skip to content

Commit ab508c9

Browse files
committed
Fix unlikely memory leak in case of namespace removal with extremely deep trees
1 parent b710f6f commit ab508c9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

NEWS

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ PHP NEWS
55
- Curl:
66
. Fix failing tests due to string changes in libcurl 8.6.0. (Ayesh)
77

8+
- DOM:
9+
. Fix unlikely memory leak in case of namespace removal with extremely deep
10+
trees. (nielsdos)
11+
812
- FPM:
913
. Fixed bug #75712 (getenv in php-fpm should not read $_ENV, $_SERVER).
1014
(Jakub Zelenka)
@@ -15,6 +19,8 @@ PHP NEWS
1519
. Fixed array key as hash to string (case insensitive) comparison typo
1620
for the second operand buffer size (albeit unused for now). (A. Slepykh)
1721

22+
5 Feb 2024, PHP 8.3.3
23+
1824
- Core:
1925
. Fixed timer leak in zend-max-execution-timers builds. (withinboredom)
2026
. Fixed bug GH-12349 (linking failure on ARM with mold). (Jan Palus)

ext/dom/element.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static void dom_deep_ns_redef(xmlNodePtr node, xmlNsPtr ns_to_redefine)
461461
if (worklist_size == worklist_capacity) {
462462
if (UNEXPECTED(worklist_capacity >= SIZE_MAX / 3 * 2 / sizeof(dom_deep_ns_redef_item))) {
463463
/* Shouldn't be possible to hit, but checked for safety anyway */
464-
return;
464+
goto out;
465465
}
466466
worklist_capacity = worklist_capacity * 3 / 2;
467467
worklist = erealloc(worklist, sizeof(dom_deep_ns_redef_item) * worklist_capacity);
@@ -472,6 +472,7 @@ static void dom_deep_ns_redef(xmlNodePtr node, xmlNsPtr ns_to_redefine)
472472
}
473473
}
474474

475+
out:
475476
efree(worklist);
476477
}
477478

0 commit comments

Comments
 (0)