File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ PHP NEWS
19
19
. Fixed bug GH-13773 (DatePeriod not taking into account microseconds for end
20
20
date). (Mark Bennewitz, Derick)
21
21
22
+ - DOM:
23
+ . Fixed bug GH-15551 (Segmentation fault (access null pointer) in
24
+ ext/dom/xml_common.h). (nielsdos)
25
+
22
26
- MySQLnd:
23
27
. Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb,
24
28
Kamil Tekiela)
Original file line number Diff line number Diff line change @@ -164,13 +164,15 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
164
164
xmlNodePtr curnode = NULL ;
165
165
166
166
php_dom_iterator * iterator = (php_dom_iterator * )iter ;
167
+ if (Z_ISUNDEF (iterator -> curobj )) {
168
+ return ;
169
+ }
167
170
171
+ dom_object * intern = Z_DOMOBJ_P (& iterator -> curobj );
168
172
zval * object = & iterator -> intern .data ;
169
173
dom_object * nnmap = Z_DOMOBJ_P (object );
170
174
dom_nnodemap_object * objmap = nnmap -> ptr ;
171
175
172
- dom_object * intern = Z_DOMOBJ_P (& iterator -> curobj );
173
-
174
176
if (intern != NULL && intern -> ptr != NULL ) {
175
177
if (objmap -> nodetype != XML_ENTITY_NODE &&
176
178
objmap -> nodetype != XML_NOTATION_NODE ) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-15551 (Segmentation fault (access null pointer) in ext/dom/xml_common.h)
3
+ --EXTENSIONS--
4
+ dom
5
+ --FILE--
6
+ <?php
7
+ $ fragment = new DOMDocumentFragment ();
8
+ $ nodes = $ fragment ->childNodes ;
9
+ $ iter = $ nodes ->getIterator ();
10
+ $ iter ->next ();
11
+ var_dump ($ iter ->valid ());
12
+ ?>
13
+ --EXPECT--
14
+ bool(false)
You can’t perform that action at this time.
0 commit comments