Skip to content

Commit da7a66d

Browse files
ju1iusGirgias
authored andcommittedSep 5, 2023
Prevents double call to internal iterator rewind handler
Closes GH-12060 Signed-off-by: George Peter Banyard <girgias@php.net>
1 parent 9658d9a commit da7a66d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
 

‎NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PHP NEWS
88
(Jeremie Courreges-Anglas)
99
. Fixed bug GH-12073 (Segfault when freeing incompletely initialized
1010
closures). (ilutov)
11+
. Fixed bug GH-12060 (Internal iterator rewind handler is called twice).
12+
(ju1ius)
1113

1214
- DOM:
1315
. Fix memory leak when setting an invalid DOMDocument encoding. (nielsdos)

‎Zend/zend_interfaces.c

+1
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ ZEND_METHOD(InternalIterator, rewind) {
585585
RETURN_THROWS();
586586
}
587587

588+
intern->rewind_called = 1;
588589
if (!intern->iter->funcs->rewind) {
589590
/* Allow calling rewind() if no iteration has happened yet,
590591
* even if the iterator does not support rewinding. */

0 commit comments

Comments
 (0)
Please sign in to comment.