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 GH-15551: Segmentation fault (access null pointer) in ext/dom/xml_common.h
This commit is contained in:
Niels Dossche
2024-08-23 19:43:32 +02:00
3 changed files with 22 additions and 2 deletions

4
NEWS
View File

@@ -19,6 +19,10 @@ PHP NEWS
. Fixed bug GH-13773 (DatePeriod not taking into account microseconds for end
date). (Mark Bennewitz, Derick)
- DOM:
. Fixed bug GH-15551 (Segmentation fault (access null pointer) in
ext/dom/xml_common.h). (nielsdos)
- MySQLnd:
. Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb,
Kamil Tekiela)

View File

@@ -164,13 +164,15 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
xmlNodePtr curnode = NULL;
php_dom_iterator *iterator = (php_dom_iterator *)iter;
if (Z_ISUNDEF(iterator->curobj)) {
return;
}
dom_object *intern = Z_DOMOBJ_P(&iterator->curobj);
zval *object = &iterator->intern.data;
dom_object *nnmap = Z_DOMOBJ_P(object);
dom_nnodemap_object *objmap = nnmap->ptr;
dom_object *intern = Z_DOMOBJ_P(&iterator->curobj);
if (intern != NULL && intern->ptr != NULL) {
if (objmap->nodetype != XML_ENTITY_NODE &&
objmap->nodetype != XML_NOTATION_NODE) {

View File

@@ -0,0 +1,14 @@
--TEST--
GH-15551 (Segmentation fault (access null pointer) in ext/dom/xml_common.h)
--EXTENSIONS--
dom
--FILE--
<?php
$fragment = new DOMDocumentFragment();
$nodes = $fragment->childNodes;
$iter = $nodes->getIterator();
$iter->next();
var_dump($iter->valid());
?>
--EXPECT--
bool(false)