Skip to content

[pull] master from php:master - #1258

Merged
pull[bot] merged 6 commits into
turkdevops:masterfrom
php:master
Sep 9, 2026
Merged

[pull] master from php:master#1258
pull[bot] merged 6 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Sep 9, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Girgias and others added 6 commits September 9, 2026 16:08
…23607)

When one iterator points at a hole and another at the next live bucket,
the relocation loop must include the iterator at that bucket's original
position. Otherwise it is moved to the following bucket's destination,
causing a nested by-reference foreach to skip an element.

Add regression coverage for packed-to-hash conversion and compaction of
a full mixed table.
* PHP-8.4:
  [skip ci] Fix NEWS entry for #23607
  Zend: Fix iterator relocation at the current element during rehash (#23607)
* PHP-8.5:
  [skip ci] Fix NEWS entry for #23607
  Zend: Fix iterator relocation at the current element during rehash (#23607)
GregorianToSdn(), JulianToSdn(), JewishToSdn() and FrenchToSdn() took C
int parameters while every PHP_FUNCTION() calling them parses zend_long,
so the arguments were implicitly narrowed before any range check ran.
Values whose low 32 bits alias into the accepted range slipped past the
guards inside the helpers: gregoriantojd(1 + 2**32, 1, 1) returned the
Julian Day of month 1 instead of 0. cal_to_jd() and cal_days_in_month()
were affected the same way through cal_to_jd_func_t.

Widen the parameters so the existing guards see the value the user
passed. The typedef's parameter names were also in the wrong order and
are fixed to match the callees.

JewishToSdn() passes its year on to FindStartOfYear(), whose first two
outputs are int, so the year is narrowed once in JewishToSdn() itself,
right after the check that leaves both year and year + 1 within int
range. FindStartOfYear() keeps its int parameter and stays unaware of
bounds its caller enforces.

Widening JewishToSdn() additionally removes a signed overflow: `sdn =
tishri1 + day - 1` was computed in int, so year 5879542 returned a
negative Julian Day.

juliantojd_overflow.phpt asserted the aliased result for year 6000000000,
which is past the supported maximum enforced since GH-22602
(INT_MAX - 4800); it now returns 0, and the test covers the largest
accepted year instead.
@pull pull Bot locked and limited conversation to collaborators Sep 9, 2026
@pull pull Bot added the ⤵️ pull label Sep 9, 2026
@pull
pull Bot merged commit 8968771 into turkdevops:master Sep 9, 2026
1 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants