[php-src] PR #25411: Fix imagecreatefromstring() continuing after the too long ValueError
| From: | lacatoire | Date: | Thu, 12 Nov 2026 09:54:26 +0000 |
| Subject: | [php-src] PR #25411: Fix imagecreatefromstring() continuing after the too long ValueError | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40569@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25411
Author: lacatoire
imagecreatefromstring() threw the ValueError for a string longer than
INT_MAX but did not return, so it went on decoding the data with the exception pending.
Return after throwing.
To reproduce:
```php
ini_set('memory_limit', '-1');
try { imagecreatefromstring(str_repeat("x", 2147483648)); } catch (ValueError $e) { echo
$e->getMessage(); }
```
Before: an extra Warning: Data is not in a recognized format. After: only the
ValueError.