[php-src] PR #16436: Fix handling of invalid iterator in zend_weakmap_iterator_get_current_get()
| From: | arnaud-lb | Date: | Mon, 14 Oct 2024 12:14:57 +0000 |
| Subject: | [php-src] PR #16436: Fix handling of invalid iterator in zend_weakmap_iterator_get_current_get() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29234@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16436
Author: arnaud-lb
Fixes GH-16371
WeakMap's implementation of
zend_object_iterator_funcs.get_current_key
doesn't handle invalid states.
Here I set the key to NULL in
zend_weakmap_iterator_get_current_get() when there is no more elements. This matches
other implementations of zend_object_iterator_funcs.get_current_key as well as the
documentation of Iterator::key.