deno
95209b35 - fix(ext/node): prevent buffer decode detach race (#34632)

Commit
149 days ago
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>
Author
Parents
Loading