php / php-src

The PHP Interpreter
https://www.php.net
Other
38.14k stars 7.74k forks source link

integer overflow tm2unixtime.c:481:12 #16048

Open chongwick opened 3 weeks ago

chongwick commented 3 weeks ago

Description

The following code:

<?php
echo date_sun_info(PHP_INT_MIN, 9, 90);
?>

Resulted in this output:

/home/dan/php-8.3.9/ext/date/lib/tm2unixtime.c:481:12: runtime error: signed integer overflow: -4611686018427403200 + -4611686018427403200 cannot be represented in type 'long long int'

PHP Version

8.3.9

Operating System

No response

cmb69 commented 3 weeks ago

https://github.com/php/php-src/blob/ae505db0c93424aaba38c5785f8a9e14638985ad/ext/date/lib/tm2unixtime.c#L473-L478