Skip to content

Fix mhash_keygen_s2k() $length truncation to int - #23951

Merged
ndossche merged 1 commit into
php:masterfrom
marc-mabe:fix/mhash-keygen-s2k-int-range
Sep 27, 2026
Merged

ndossche merged 1 commit into
php:masterfrom
marc-mabe:fix/mhash-keygen-s2k-int-range

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

A $length above INT_MAX was truncated to int before the range check, so e.g. 2**32 + 16 silently returned 16 bytes. Throw a ValueError instead.

fixes #23950

A $length above INT_MAX was truncated to int before the range check,
so e.g. 2**32 + 16 silently returned 16 bytes. Throw a ValueError instead.
@ndossche
ndossche merged commit f5d89c8 into php:master Sep 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integer overflow in mhash_keygen_s2k() length

2 participants