Skip to content

Commit 187a72d

Browse files
committed
Remove bogus generator iterator dtor
Fixes a use-after-free encountered in Symfony's SecurityBundle. I don't have a reproducer for this, and believe the issue can only occur if we leak an iterator (the leak is a separate issue). We should not free the generator iterator here, because we do not own it. The code that fetched the iterator is responsible for releasing it. In the rare case where we do hit this code-path, we cause a use-after-free.
1 parent fc6f53d commit 187a72d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

Zend/zend_generators.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
253253
}
254254

255255
zend_object_std_dtor(&generator->std);
256-
257-
if (generator->iterator) {
258-
zend_iterator_dtor(generator->iterator);
259-
}
260256
}
261257
/* }}} */
262258

0 commit comments

Comments
 (0)