mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
commit
e3fe9a93c7
5 changed files with 41 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -2,6 +2,9 @@ PHP NEWS
|
|||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 8.4.10
|
||||
|
||||
- Calendar:
|
||||
. Fixed jewishtojd overflow on year argument. (David Carlier)
|
||||
|
||||
- Core:
|
||||
. Fixed bug GH-18833 (Use after free with weakmaps dependent on destruction
|
||||
order). (Daniil Gentili)
|
||||
|
|
|
@ -490,6 +490,11 @@ PHP_FUNCTION(jewishtojd)
|
|||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (ZEND_LONG_EXCEEDS_INT(year)) {
|
||||
zend_argument_value_error(3, "must be between %d and %d", INT_MIN, INT_MAX);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
RETURN_LONG(JewishToSdn(year, month, day));
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -710,7 +710,7 @@ zend_long JewishToSdn(
|
|||
int yearLength;
|
||||
int lengthOfAdarIAndII;
|
||||
|
||||
if (year <= 0 || day <= 0 || day > 30) {
|
||||
if (year <= 0 || year >= 6000 || day <= 0 || day > 30) {
|
||||
return (0);
|
||||
}
|
||||
switch (month) {
|
||||
|
|
11
ext/calendar/tests/gh16234_2.phpt
Normal file
11
ext/calendar/tests/gh16234_2.phpt
Normal file
|
@ -0,0 +1,11 @@
|
|||
--TEST--
|
||||
GH-16234 jewishtojd overflow on year argument
|
||||
--EXTENSIONS--
|
||||
calendar
|
||||
--FILE--
|
||||
<?php
|
||||
jewishtojd(10, 6, 2147483647);
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE
|
21
ext/calendar/tests/gh16234_2_64.phpt
Normal file
21
ext/calendar/tests/gh16234_2_64.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--TEST--
|
||||
GH-16234 jewishtojd overflow on year argument
|
||||
--EXTENSIONS--
|
||||
calendar
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
jewishtojd(10, 6, PHP_INT_MIN);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
jewishtojd(): Argument #3 ($year) must be between %i and %d
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue