Bun.write(file, Bun.stdin): splice a pipe source into any destination on Linux - #36692
Open
robobun wants to merge 6 commits into
Open
Bun.write(file, Bun.stdin): splice a pipe source into any destination on Linux#36692robobun wants to merge 6 commits into
robobun wants to merge 6 commits into
Claude / Claude Code Review
completed
Aug 2, 2026 in 27m 4s
Code review found 1 potential issue
Found 1 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/runtime/webcore/blob/copy_file.rs:881-886 |
macOS/FreeBSD post-fcopyfile ftruncate not gated on bun_opened_dest |
Annotations
Check warning on line 886 in src/runtime/webcore/blob/copy_file.rs
claude / Claude Code Review
macOS/FreeBSD post-fcopyfile ftruncate not gated on bun_opened_dest
The `bun_opened_dest` guard was added to all three Linux read/write-fallback `ftruncate` sites, but the macOS post-`fcopyfile` `ftruncate` (which this PR restructures) and the FreeBSD block still truncate `self.destination_fd` unconditionally — so on macOS `Bun.write(Bun.stdout, Bun.file('big.txt').slice(0, N))` with `>> log.txt` will `ftruncate(1, N)` and destroy the pre-existing bytes. Pre-existing and a narrow trigger (sliced regular-file source + user fd dest), but per REVIEW.md's "fix the w
Loading