Skip to content

Bun.build: report an error for HTML rooted script src paths >= 4096 bytes instead of aborting - #35860

Closed
robobun wants to merge 6 commits into
mainfrom
farm/c12a0373/html-rooted-src-long-path-panic
Closed

robobun wants to merge 6 commits into
mainfrom
farm/c12a0373/html-rooted-src-long-path-panic

ci: retrigger

962bbd2
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 43m 35s

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/resolver/resolver.rs:5704-5710 Same-class panic uncovered: absolute-import '..' renormalization writes buf[MAX_PATH_BYTES]

Annotations

Check failure on line 5710 in src/resolver/resolver.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Same-class panic uncovered: absolute-import '..' renormalization writes buf[MAX_PATH_BYTES]

A fourth same-class site is still unguarded, upstream of the three now checked: at `resolver.rs:1821` the absolute-import `..`-renormalization branch writes `buf[len] = platform.separator()` where `buf = bufs!(relative_abs_path)` is `[u8; MAX_PATH_BYTES]` and `len` can equal `MAX_PATH_BYTES` — `join_abs_string_buf_checked`'s slow-path rejection is `> buf.len()`, not `>=`, so it returns `Some` at exactly the limit. Reachable via the same HTML vector with e.g. `<script src="/foo..PADDING/">` (the