Skip to content

Commit cfffb62

Browse files
authored
aot loader: Verify global value type (#3560)
Fix issue reported by Oss-fuzz test (#69798). https://oss-fuzz.com/testcase-detail/5963842371256320
1 parent 95f7717 commit cfffb62

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/iwasm/aot/aot_loader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,9 @@ load_globals(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
21702170
read_uint8(buf, buf_end, globals[i].type.val_type);
21712171
read_uint8(buf, buf_end, globals[i].type.is_mutable);
21722172

2173+
if (!is_valid_value_type(globals[i].type.val_type))
2174+
return false;
2175+
21732176
buf = align_ptr(buf, 4);
21742177

21752178
if (!load_init_expr(&buf, buf_end, module, &globals[i].init_expr,

0 commit comments

Comments
 (0)