mirror of
https://github.com/php/php-src.git
synced 2024-11-23 01:44:06 +08:00
Merge branch 'PHP-8.4'
This commit is contained in:
commit
3942972bef
@ -148,11 +148,15 @@ void SdnToGregorian(
|
||||
int dayOfYear;
|
||||
|
||||
if (sdn <= 0 ||
|
||||
sdn > (LONG_MAX - 4 * GREGOR_SDN_OFFSET) / 4) {
|
||||
sdn > (ZEND_LONG_MAX - 4 * GREGOR_SDN_OFFSET) / 4) {
|
||||
goto fail;
|
||||
}
|
||||
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
|
||||
|
||||
if (temp < 0 || (temp / DAYS_PER_400_YEARS) > INT_MAX) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Calculate the century (year/100). */
|
||||
century = temp / DAYS_PER_400_YEARS;
|
||||
|
||||
|
11
ext/calendar/tests/gh16235.phpt
Normal file
11
ext/calendar/tests/gh16235.phpt
Normal file
@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
GH-16235 (jdtogregorian overflow on argument)
|
||||
--EXTENSIONS--
|
||||
calendar
|
||||
--FILE--
|
||||
<?php
|
||||
jdtogregorian(536838867);
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
Loading…
Reference in New Issue
Block a user