Skip to content

integer overflow in calendar.c #19371

@chongwick

Description

@chongwick

Description

The following code:

<?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

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions