Skip to content

Commit

Permalink
aot loader: Check import global value type before using (bytecodealli…
Browse files Browse the repository at this point in the history
…ance#3571)

Fix issue reported by Oss-fuzz test (#69798).
  • Loading branch information
lum1n0us authored Jun 26, 2024
1 parent 74dbafc commit 65bf04e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/iwasm/aot/aot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,10 @@ load_import_globals(const uint8 **p_buf, const uint8 *buf_end,
read_string(buf, buf_end, import_globals[i].module_name);
read_string(buf, buf_end, import_globals[i].global_name);

if (!is_valid_value_type(import_globals[i].type.val_type)) {
return false;
}

#if WASM_ENABLE_LIBC_BUILTIN != 0
if (wasm_native_lookup_libc_builtin_global(
import_globals[i].module_name, import_globals[i].global_name,
Expand Down

0 comments on commit 65bf04e

Please sign in to comment.