Merge branch 'PHP-8.4'

This commit is contained in:
David Carlier 2024-11-06 12:53:40 +00:00
commit 3942972bef
No known key found for this signature in database
GPG Key ID: 8486F847B4B94EF1
2 changed files with 16 additions and 1 deletions

View File

@ -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;

View File

@ -0,0 +1,11 @@
--TEST--
GH-16235 (jdtogregorian overflow on argument)
--EXTENSIONS--
calendar
--FILE--
<?php
jdtogregorian(536838867);
echo "DONE";
?>
--EXPECT--
DONE