Skip to content
Commit Detail

Commit e7f150d

Author
James M Snell <jsnell@cloudflare.com> 2026-03-16 19:54:27 -0700
Parents
7c53dcb
Tree
bfe540b
Avoid fragile V8 temporary lifetime in RSA JWK BIGNUM conversion

`simdutfBase64UrlDecodeChecked()` returns a `JsUint8Array` backed by
the V8 heap. Chaining `.asArrayPtr()` on the temporary produced a
`kj::ArrayPtr` pointing into V8 memory that was only kept alive by
C++ temporary lifetime rules. While technically safe (the temporary
lives until the end of the full-expression), this is fragile — any
refactoring that stores the `ArrayPtr` separately would create a
dangling pointer.

Store each `JsUint8Array` in a named variable before extracting the
`ArrayPtr`, making the lifetime relationship explicit.

Files changed

1 file changed~1 modified