Skip to content

Commit 65bf04e

Browse files
authored
aot loader: Check import global value type before using (#3571)
Fix issue reported by Oss-fuzz test (#69798).
1 parent 74dbafc commit 65bf04e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/iwasm/aot/aot_loader.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,10 @@ load_import_globals(const uint8 **p_buf, const uint8 *buf_end,
20972097
read_string(buf, buf_end, import_globals[i].module_name);
20982098
read_string(buf, buf_end, import_globals[i].global_name);
20992099

2100+
if (!is_valid_value_type(import_globals[i].type.val_type)) {
2101+
return false;
2102+
}
2103+
21002104
#if WASM_ENABLE_LIBC_BUILTIN != 0
21012105
if (wasm_native_lookup_libc_builtin_global(
21022106
import_globals[i].module_name, import_globals[i].global_name,

0 commit comments

Comments
 (0)