Skip to content

Fix crash in Bun.file().writer() with invalid path/fd options - #30299

Closed
robobun wants to merge 1 commit into
mainfrom
farm/bdcecdd8/fix-filesink-writer-options-crash
Closed

Fix crash in Bun.file().writer() with invalid path/fd options#30299
robobun wants to merge 1 commit into
mainfrom
farm/bdcecdd8/fix-filesink-writer-options-crash

Fix crash in Bun.file().writer() with invalid path/fd options

c13f82d
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 5, 2026 in 13m 15s

Code review found 1 potential issue

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

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/runtime/webcore/Blob.zig:2978-2979 Pre-existing leak: allocated input_path overwritten without deinit

Annotations

Check notice on line 2979 in src/runtime/webcore/Blob.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Pre-existing leak: allocated input_path overwritten without deinit

Pre-existing minor leak (not introduced by this PR, but you're touching the exact line): when `fromJSWithTag` returns `.FileSink` with a heap-allocated `input_path` (i.e. the user passed `{ path: "…" }` and `toSlice` allocated for UTF-8 conversion), line 2979 overwrites `stream_start.FileSink.input_path` without calling `.deinit()` on the previous value, leaking the `ZigString.Slice`. Adding `stream_start.FileSink.input_path.deinit();` before the assignment would close it.