Skip to content
Commit Detail

Commit 43f60f0

Author
Albert Pedersen <apedersen@cloudflare.com> 2026-02-19 13:56:30 +0100
Parents
686673f
Tree
4345a90
Guard BYOB reader against buffer resize during pending read

When a BYOB read is pending and the underlying resizable ArrayBuffer is
resized, the destination pointer may reference decommitted virtual memory,
causing a SIGSEGV in the memcpy inside tryRead. For resizable buffers,
allocate a temporary heap buffer for the read and copy the data back into
the user's buffer in the .then() callback after validating it is still
large enough. Also add pre-read validation to return a zero-length view
when byteOffset already exceeds the current ByteLength.

Signed-off-by: James M Snell <jsnell@cloudflare.com>

Files changed