Skip to content

Signed integer overflow in ext/date/lib/unixtime2tm.c #13881

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
date_default_timezone_set("Europe/London");
echo date(DATE_ATOM."\n".DATE_RFC2822."\nc\nr\no\ny\nY\nU\n\n", PHP_INT_MIN);
?>

Resulted in this output:

/php-src/ext/date/lib/unixtime2tm.c:141:32: runtime error: signed integer overflow: -9223372036854775808 + -75 cannot be represented in type 'long long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/date/lib/unixtime2tm.c:141:32 in

PHP Version

PHP 8.4.0-dev

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