[php-src] Issue #8235: iterator_count runs indefinitely if iterator doesn't complete
| From: | cmb69 | Date: | Mon, 21 Mar 2022 18:37:49 +0000 |
| Subject: | [php-src] Issue #8235: iterator_count runs indefinitely if iterator doesn't complete | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240449@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8235
Comment Author: cmb69
> Since iterator_count will continue running, and eventually overflow, no exception is thrown.
I think we need to bail out in case of overflow:
https://github.com/php/php-src/blob/0ba92163a0a6927a1997e76c16adfc83488c27af/ext/spl/spl_iterators.c#L3130
While that may not happen in practice, wrapping around certainly makes no sense.