[php-src] PR #23720: Adding null check in spl_array_it_get_current_data function
| From: | burkeartem | Date: | Thu, 17 Sep 2026 11:10:31 +0000 |
| Subject: | [php-src] PR #23720: Adding null check in spl_array_it_get_current_data function | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38527@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23720
Author: burkeartem
**Problem**: There's a potential NULL dereference in
spl_array_it_get_current_data. After having been compared to a NULL value at
[spl_array.c:1563](https://github.com/php/php-src/blob/fca72841a5d41b11c0e60ed0906af6af302741ca/ext/spl/spl_array.c#L1563),
pointer data is passed to Z_TYPE_P
[here](https://github.com/php/php-src/blob/fca72841a5d41b11c0e60ed0906af6af302741ca/ext/spl/spl_array.c#L1569),
where it is dereferenced.
**Solution**: adding a simple NULL-check for data.