Skip to content

Fix null deref in Bun.inspect when Proxy prototype traps throw#30030

Closed
robobun wants to merge 1 commit into
mainfrom
farm/48d1086a/fix-inspect-proxy-prototype
Closed

Fix null deref in Bun.inspect when Proxy prototype traps throw#30030
robobun wants to merge 1 commit into
mainfrom
farm/48d1086a/fix-inspect-proxy-prototype

Fix null deref in Bun.inspect when Proxy prototype traps throw

0ed851d
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 1, 2026 in 18m 0s

Code review found 1 potential issue

Found 1 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/bun.js/bindings/bindings.cpp:5364-5370 Same getPrototype().getObject() null-deref pattern exists in napi.cpp

Annotations

Check notice on line 5370 in src/bun.js/bindings/bindings.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

Same getPrototype().getObject() null-deref pattern exists in napi.cpp

Heads up (pre-existing, not introduced by this PR): the same `getPrototype(globalObject).getObject()` null-deref pattern fixed here also exists at `src/bun.js/bindings/napi.cpp:1837` inside `napi_get_all_property_names`. A native addon calling that API with `napi_key_include_prototypes` + an enumerable/writable/configurable filter on an object whose prototype chain has a Proxy with a throwing `getPrototypeOf` (or `getOwnPropertyDescriptor`) trap will crash the same way. Might be worth applying t