sea: handle NUL bytes in asset keys · nodejs/node@3126ce5 · GitHub
Skip to content

Commit 3126ce5

Browse files
Archkonaduh95
authored andcommitted
sea: handle NUL bytes in asset keys
Construct the asset lookup string_view with the explicit Utf8Value length so embedded NUL bytes do not truncate keys. Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> PR-URL: #64773 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 64a8843 commit 3126ce5

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/node_sea.cc

Lines changed: 1 addition & 1 deletion

test/fixtures/sea/assets/sea-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"main": "sea.js",
33
"output": "sea-prep.blob",
44
"assets": {
5+
"a": "utf8_test_text.txt",
6+
"a\u0000b": "person.jpg",
57
"utf8_test_text.txt": "utf8_test_text.txt",
68
"person.jpg": "person.jpg"
79
}

test/fixtures/sea/assets/sea.js

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)