[php-src] Issue #20602: integer overflow in imagescale
[email protected] (chongwick)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/20602 Author: chongwick ### Description The following code: ```php <?php $v_17401 = 2; $v_3914 = 1; $v_3915 = imagecreatetruecolor($v_17401,$v_3914,); $v_3917 = 1; $v_3918 = -($v_3917); $v_17364 = 9223372036854775807; $v_17415 = 1; $v_3922 = imagescale($v_3915,$v_3918,$v_17364,$v_17415,); ``` Resulted in this output: ``` /home/w023dtc/nightly_php/php-src/ext/gd/gd.c:3937:18: runtime error: signed integer overflow: 9223372036854775807 * 2 cannot be represented in type 'long' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/w023dtc/nightly_php/php-src/ext/gd/gd.c:3937:18 ``` But I expected this output instead: ``` ``` ### PHP Version ```plain nightly ``` ### Operating System _No response_