[php-src] Issue #21321: integer overflow image ellipse
| From: | chongwick | Date: | Sun, 01 Mar 2026 17:30:12 +0000 |
| Subject: | [php-src] Issue #21321: integer overflow image ellipse | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251739@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/21321
Author: chongwick
### Description
The following code:
```php
<?php
$v_11265 = 400;
$v_11266 = 300;
$v_11267 = imagecreatetruecolor($v_11265,$v_11266,);
$v_18379 = 2147483646;
$v_18371 = 100;
$v_11270 = 300;
$v_11271 = 200;
$v_11272 = 16777215;
$v_11273 = imageellipse($v_11267,$v_18379,$v_18371,$v_11270,$v_11271,$v_11272,);
```
Resulted in this output:
```
/home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd.c:1807:13: runtime error: signed integer overflow:
-2147483648 - 1 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd.c:1807:13
```
But I expected this output instead:
```
```
### PHP Version
```plain
nightly
```
### Operating System
_No response_