1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

This commit is contained in:
David Carlier
2024-11-06 12:53:07 +00:00
3 changed files with 19 additions and 1 deletions

3
NEWS
View File

@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.4.0
- Calendar:
. Fixed jdtogregorian overflow. (David Carlier)
- PDO:
. Fixed memory leak of `setFetchMode()`. (SakiTakamachi)

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