Skip to content

[pull] master from php:master#1028

Merged
pull[bot] merged 22 commits into
turkdevops:masterfrom
php:master
Jun 24, 2026
Merged

[pull] master from php:master#1028
pull[bot] merged 22 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Jun 24, 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 : )

ndossche and others added 22 commits June 24, 2026 10:52
Avoid hash-based lookup if we already know the offset in the table
anyway.
Now, shmop_open() and shm_attach() accepted zend_long keys and passed them directly to SysV shared memory APIs, where they may be truncated to key_t.

Generally we should throw ValurErrors on those issues. Fixes #9945
Strip a leading "\\" before lowercasing, mirroring zend_lookup_class_ex(),
so both spellings resolve identically.
* PHP-8.4:
  NEWS entries for recent SPL bug fixes
  ext/spl: ignore leading namespace separator in spl_autoload() (#22323)
  ext/spl: fix class_parents for classes with leading slash in non-autoload mode (#22283)
* PHP-8.5:
  NEWS entries for recent SPL bug fixes
  ext/spl: ignore leading namespace separator in spl_autoload() (#22323)
  ext/spl: fix class_parents for classes with leading slash in non-autoload mode (#22283)
_php_ldap_control_from_array() allocated the sort_keys array with
safe_emalloc() and only wrote its NULL terminator after the per-key loop
finished. A sort key missing the "attr" entry makes the loop bail out
early, leaving the array partially uninitialized; the failure cleanup
then walks it as a NULL-terminated list and calls efree() on the
uninitialized slots. Zero the array after allocation so the unwritten
slots are NULL. Reachable from userland via the $controls argument of
ldap_search() and the other control-taking LDAP functions.

Closes GH-22342
* PHP-8.4:
  Fix freeing uninitialized memory in LDAP sort control parsing
* PHP-8.5:
  Fix freeing uninitialized memory in LDAP sort control parsing
…21658)

The from and user_agent INI settings and the user_agent stream context
option were written into HTTP request headers without stripping CR/LF
characters, allowing header injection.

Truncate at the first \r or \n and emit E_WARNING. The from and
user_agent globals are stored as zend_string so the check scans the
full length and a NUL byte no longer pre-truncates the value before the
CR/LF scan.

Fixes GH-17976
php_posix_passwd_to_array() passed pw_name, pw_passwd, pw_gecos, pw_dir
and pw_shell straight to add_assoc_string() with no NULL guard, so a NULL
field segfaults via zend_string_init(). glibc's files NSS backend
normalizes empty fields to "", but third-party NSS modules (nss-systemd,
nss-ldap, sssd and other directory backends) populate struct passwd
directly and may leave fields NULL. Guard each string field and emit null
instead, mirroring the existing pw/gr handling in php_posix_group_to_array().

Closes GH-22426
* PHP-8.4:
  Fix posix_getpwnam()/posix_getpwuid() crash on NULL passwd fields
* PHP-8.5:
  Fix posix_getpwnam()/posix_getpwuid() crash on NULL passwd fields
intl_charFromString() computed the UTF-8 output capacity as
from.length() * 3 in int32_t arithmetic. For a UnicodeString longer than
INT32_MAX/3 UTF-16 units the multiply overflows (UB); capacity can go
negative, making zend_string_alloc() request a near-SIZE_MAX block, or
wrap small, undersizing the buffer that u_strToUTF8WithSub() then writes
into. Reject the over-long input with U_BUFFER_OVERFLOW_ERROR up front,
mirroring the existing INT32_MAX guard in the sibling intl_stringFromChar().

Closes GH-22427
* PHP-8.4:
  Fix int32_t overflow in intl_charFromString() capacity calculation
* PHP-8.5:
  Fix int32_t overflow in intl_charFromString() capacity calculation
This fixes some typos and inconsistencies (e.g. markdown backticks which are
not used, since these are not markdown) and reflows the lines (some of them
were too wide).
imageloadfont_short_read packed the font header with pack('V4', ...)
(little-endian), but imageloadfont() reads the header as native-endian
ints. On big-endian hosts (PPC64 nightly) the byte-swapped values
overflow the INT_MAX guard before the FLIPWORD fallback runs, so the
font is rejected and the test fails. Pack the fields with 'i' to keep
the header valid regardless of host endianness.

Closes GH-22416
* PHP-8.4:
  ext/gd: pack imageloadfont short-read test in native byte order
* PHP-8.5:
  ext/gd: pack imageloadfont short-read test in native byte order
@pull pull Bot locked and limited conversation to collaborators Jun 24, 2026
@pull pull Bot added the ⤵️ pull label Jun 24, 2026
@pull pull Bot merged commit 348c139 into turkdevops:master Jun 24, 2026
1 of 3 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.

7 participants