mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
This commit is contained in:
commit
0f55c20afd
4 changed files with 38 additions and 1 deletions
|
@ -493,6 +493,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