[php-src] Issue #19371: integer overflow in calendar.c

From: Date: Tue, 05 Aug 2025 13:19:59 +0000
Subject: [php-src] Issue #19371: integer overflow in calendar.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-250560@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/19371 Author: chongwick ### Description The following code: ```php <?php $v2 = PHP_INT_MAX; $v1 = cal_days_in_month(CAL_GREGORIAN, 12, $v2); ``` Resulted in this output: ``` php-src/ext/calendar/calendar.c:219:36: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int' ``` But I expected this output instead: ``` ``` ### PHP Version ```plain nightly ``` ### Operating System ubuntu 22.04

« previous php.bugs (#250560) next »