Skip to content

shell: fail the command when a > ${buf} redirect overflows the target Buffer - #34698

Open
robobun wants to merge 6 commits into
mainfrom
claude/farm/ada0ba20/shell-arraybuf-enospc
Open

shell: fail the command when a > ${buf} redirect overflows the target Buffer#34698
robobun wants to merge 6 commits into
mainfrom
claude/farm/ada0ba20/shell-arraybuf-enospc

test: cover Uint8Array view with offset; assert ENOSPC exit for subpr…

69bdefa
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 19, 2026 in 13m 43s

Code review found 1 important issue

Found 5 candidates, confirmed 4. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/shell/subproc.rs:2226-2230 PR breaks leak.test.ts: existing > ${buf} overflow tests now fail exit-code assertion

Annotations

Check failure on line 2230 in src/runtime/shell/subproc.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

PR breaks leak.test.ts: existing > ${buf} overflow tests now fail exit-code assertion

This behavior change breaks `test/js/bun/shell/leak.test.ts`, which redirects `cat ${import.meta.filename}` / `echo ${import.meta.filename}` into 64/128-byte ArrayBuffer/Buffer targets via `TestBuilder.command` and asserts the default `expected_exit_code = 0` — CI (build #75749) confirms it failing on 🪟 2019 x64-baseline, 🪟 2019 x64, 🪟 11 aarch64, and 🐧 13 x64-asan for 69bdefac. This is separate from the `to_system_error()` leak on line 2230: 3 of the 4 red lanes are Windows, which takes the bui