Skip to content

fix(napi): handle nul byte in object key#2385

Merged
Brooooooklyn merged 7 commits intonapi-rs:mainfrom
hi-ogawa:fix-nul-byte-in-object-key
Dec 3, 2024
Merged

fix(napi): handle nul byte in object key#2385
Brooooooklyn merged 7 commits intonapi-rs:mainfrom
hi-ogawa:fix-nul-byte-in-object-key

Conversation

@hi-ogawa
Copy link
Copy Markdown
Contributor

@hi-ogawa hi-ogawa commented Dec 2, 2024

I added nul safe handling to JsObject::set and get. This covers map conversion used in rolldown.

I initially only fixed map conversion, but I moved the same logic to JsObject 7751530 since the underlying issue is there. I'm not sure about the perf impact of extra napi_create_string_utf8 call on each get/set.

@hi-ogawa hi-ogawa marked this pull request as ready for review December 2, 2024 07:56
@Brooooooklyn Brooooooklyn changed the title fix: handle nul byte in object key fix(napi): handle nul byte in object key Dec 2, 2024
@Brooooooklyn Brooooooklyn merged commit 61543c0 into napi-rs:main Dec 3, 2024
@hi-ogawa hi-ogawa deleted the fix-nul-byte-in-object-key branch December 3, 2024 06:36
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.

Unexpect Nul Error of CString while creating javascript object

2 participants