Skip to content

Commit 77c21ca

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-14124: Segmentation fault on unknown address 0x0001ffff8041 with XML extension under certain memory limit (#14126)
2 parents cd2dea7 + 427c244 commit 77c21ca

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ PHP NEWS
1313
. Fix crash when calling childNodes next() when iterator is exhausted.
1414
(nielsdos)
1515

16+
- XML:
17+
. Fixed bug GH-14124 (Segmentation fault with XML extension under certain
18+
memory limit). (nielsdos)
19+
1620
09 May 2024, PHP 8.3.7
1721

1822
- Core:

ext/xml/xml.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ PHP_FUNCTION(xml_parse_into_struct)
12861286
parser->level = 0;
12871287
xml_parser_free_ltags(parser);
12881288
parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0);
1289+
memset(parser->ltags, 0, XML_MAXLEVEL * sizeof(char *));
12891290

12901291
XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler);
12911292
XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler);

0 commit comments

Comments
 (0)