Append \0 to every name string in aot name section (#3249)

Since strings in .name section in .wasm is not c-style, need to append
a `\0` to each string in .name section in AOT file when emitting.
This commit is contained in:
liang.he
2024-03-26 14:27:20 +08:00
committed by GitHub
parent d8d8f8ce04
commit 498eb5d54a
3 changed files with 23 additions and 9 deletions

View File

@ -4923,7 +4923,7 @@ load_user_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
}
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
if (memcmp(p, "name", 4) == 0) {
if (name_len == 4 && memcmp(p, "name", 4) == 0) {
module->name_section_buf = buf;
module->name_section_buf_end = buf_end;
p += name_len;