[php-src] Issue #20047: ub in gd_interpolation.c
| From: | chongwick | Date: | Fri, 03 Oct 2025 12:55:05 +0000 |
| Subject: | [php-src] Issue #20047: ub in gd_interpolation.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250984@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20047
Author: chongwick
### Description
The following code:
```php
<?php
$v_1115 = 1;
$v_2154 = 1;
$v_1078 = 2147483647;
$v_2156 = 1;
$v_2157 = 1;
$v_2158 = 1;
$v_2152 = array(0 => $v_1115,1 => $v_2154,2 => $v_1078,3 => $v_2156,4 => $v_2157,5
=> $v_2158,);
$v_2159 = 8;
$v_2160 = 8;
$v_2161 = imagecreatetruecolor($v_2159,$v_2160,);
try{
$v_2165 = imageaffine($v_2161,$v_2152,);
}
catch (ValueError $e){
}
```
Resulted in this output:
```
/home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd_interpolation.c:2084:17: runtime error:
1.71799e+10 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/home/w023dtc/nightly_php/php-src/ext/gd/libgd/gd_interpolation.c:2084:17
```
### PHP Version
```plain
nightly
```
### Operating System
ubuntu 22.04