You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
main/io & main/poll: 32-bit integer overflow in timeout_ms calculation and kqueue realloc size #25860
main/io/php_io_copy_windows.c:51, php_io_copy_linux.c:55, php_io.c:106: int timeout_ms = fd->timeout.tv_sec * 1000 + fd->timeout.tv_usec / 1000; overflows 32-bit int when tv_sec > INT_MAX / 1000, turning a large finite timeout into a negative value (WSAPoll/poll infinite wait).
main/poll/poll_backend_kqueue.c:304 (and epoll/wsapoll/eventport): max_events * sizeof(struct kevent) in php_poll_realloc() lacks a 32-bit size_t multiplication overflow check.
Suggested fix: Compute timeout_ms in int64_t clamped to [0, INT_MAX] (keeping -1 only for tv_sec == -1), and check (size_t)max_events <= SIZE_MAX / sizeof(...) before php_poll_realloc().
Activity
main/io: stream_copy_to_stream() socket timeout overflow.