mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
commit
d1a313e12c
3 changed files with 29 additions and 2 deletions
1
NEWS
1
NEWS
|
@ -14,6 +14,7 @@ PHP NEWS
|
||||||
. Fixed GH-16241: easter_days/easter_date overflow on year argument.
|
. Fixed GH-16241: easter_days/easter_date overflow on year argument.
|
||||||
(David Carlier)
|
(David Carlier)
|
||||||
. Fixed GH-16263: jddayofweek overflow. (cmb)
|
. Fixed GH-16263: jddayofweek overflow. (cmb)
|
||||||
|
. Fixed GH-16234: jewishtojd overflow. (nielsdos)
|
||||||
|
|
||||||
- CLI:
|
- CLI:
|
||||||
. Fixed bug GH-16137: duplicate http headers when set several times by
|
. Fixed bug GH-16137: duplicate http headers when set several times by
|
||||||
|
|
|
@ -429,16 +429,31 @@ static void MoladOfMetonicCycle(
|
||||||
zend_long *pMoladHalakim)
|
zend_long *pMoladHalakim)
|
||||||
{
|
{
|
||||||
register zend_ulong r1, r2, d1, d2;
|
register zend_ulong r1, r2, d1, d2;
|
||||||
|
zend_long chk;
|
||||||
|
|
||||||
/* Start with the time of the first molad after creation. */
|
/* Start with the time of the first molad after creation. */
|
||||||
r1 = NEW_MOON_OF_CREATION;
|
r1 = NEW_MOON_OF_CREATION;
|
||||||
|
chk = (zend_long)metonicCycle;
|
||||||
|
|
||||||
|
if (chk > (ZEND_LONG_MAX - NEW_MOON_OF_CREATION) / (HALAKIM_PER_METONIC_CYCLE & 0xFFFF)) {
|
||||||
|
*pMoladDay = 0;
|
||||||
|
*pMoladHalakim = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32
|
/* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32
|
||||||
* bits of the result will be in r2 and the lower 16 bits will be
|
* bits of the result will be in r2 and the lower 16 bits will be
|
||||||
* in r1. */
|
* in r1. */
|
||||||
r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF);
|
r1 += chk * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF);
|
||||||
|
|
||||||
|
if (chk > (ZEND_LONG_MAX - (r1 >> 16)) / ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF)) {
|
||||||
|
*pMoladDay = 0;
|
||||||
|
*pMoladHalakim = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
r2 = r1 >> 16;
|
r2 = r1 >> 16;
|
||||||
r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF);
|
r2 += chk * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF);
|
||||||
|
|
||||||
/* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the
|
/* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the
|
||||||
* upper 16 bits of the quotient will be in d2 and the lower 16 bits
|
* upper 16 bits of the quotient will be in d2 and the lower 16 bits
|
||||||
|
|
11
ext/calendar/tests/gh16234.phpt
Normal file
11
ext/calendar/tests/gh16234.phpt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16234 jewishtojd overflow on year argument
|
||||||
|
--EXTENSIONS--
|
||||||
|
calendar
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
jewishtojd(1218182888, 1, 1218182888);
|
||||||
|
echo "DONE";
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
DONE
|
Loading…
Add table
Add a link
Reference in a new issue