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:
3
NEWS
3
NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 8.4.0
|
||||
|
||||
- Calendar:
|
||||
. Fixed jdtogregorian overflow. (David Carlier)
|
||||
|
||||
- PDO:
|
||||
. Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user