Skip to content

ext/standard: Reject overflowing stream timeout sums - #341

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-y2y0
Closed

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-y2y0

Conversation

@iliaal

@iliaal iliaal commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

stream_set_timeout() can overflow when seconds and microseconds are combined, or narrow the result on Windows.

Validate the normalized value against the platform timeout range before conversion, preserving signed components and the -1 unlimited timeout.

This addresses the overflow separately from the timeout policy changes in php#16246.

@iliaal
iliaal changed the base branch from master to PHP-8.4 September 24, 2026 13:37
Check the normalized timeout against the actual timeval seconds field
before conversion. Preserve signed components and the -1 unlimited timeout,
including on platforms with 64-bit time_t and 32-bit PHP integers.
@iliaal iliaal changed the title ext/standard: Validate stream timeouts ext/standard: Reject overflowing stream timeout sums Oct 19, 2026
@iliaal

iliaal commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Promoted to php#24439: php#24439

@iliaal iliaal closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant