Skip to content

Conversation

@bnoordhuis
Copy link
Contributor

JS_ReadTypedArray contains a hack where it briefly puts a NULL object pointer in the object reference table to work around a chicken-and-egg problem.

Malicious or corrupt BJSON could reference that entry while it was still NULL and trigger a segfault. Guard against that.

Fixes: #1321

JS_ReadTypedArray contains a hack where it briefly puts a NULL object
pointer in the object reference table to work around a chicken-and-egg
problem.

Malicious or corrupt BJSON could reference that entry while it was
still NULL and trigger a segfault. Guard against that.

Fixes: quickjs-ng#1321
@bnoordhuis bnoordhuis merged commit 5c47676 into quickjs-ng:master Feb 1, 2026
122 checks passed
@bnoordhuis bnoordhuis deleted the fix1321 branch February 1, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NULL Pointer Dereference in bjson (JS_ReadTypedArray)

2 participants