SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 16 Rust

fix(ext/node): prevent buffer decode detach race (#34632)

Fix a reentrancy-sensitive Buffer decode path by parsing slice indexes
before borrowing ArrayBufferView contents, then reacquiring the contents
after any user-defined coercion can run. Mark the op reentrant because
V8 integer coercion can execute JS and invoke other ops.

Add a unit-node regression that detaches the backing ArrayBuffer during
utf8Slice index coercion and verifies the operation fails safely instead
of using stale memory.

Tests:
- cargo fmt --check
- cargo build --bin deno
- cargo test -p unit_node_tests --test unit_node -- buffer

Closes denoland/divybot#441

---------

Co-authored-by: divybot <divybot@users.noreply.github.com>
Co-authored-by: Divy Srivastava <me@littledivy.com>
E
em committed
95209b3578372fda1443fd515d7f766e67a14848
Parent: 49a1c40
Committed by GitHub <noreply@github.com> on 6/1/2026, 1:26:46 AM