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:
@ -1942,7 +1942,7 @@ load_user_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
|
||||
bh_assert(name_len > 0 && p + name_len <= p_end);
|
||||
|
||||
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
|
||||
if (memcmp(p, "name", 4) == 0) {
|
||||
if (name_len == 4 && memcmp(p, "name", 4) == 0) {
|
||||
p += name_len;
|
||||
handle_name_section(p, p_end, module, is_load_from_file_buf, error_buf,
|
||||
error_buf_size);
|
||||
|
||||
Reference in New Issue
Block a user