Skip to content

Commit 3cce6fd

Browse files
authored
avoid access null pointer (#4262)
1 parent 510bb11 commit 3cce6fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/iwasm/interpreter/wasm_loader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
820820
#else
821821
cur_value.gc_obj = NULL_REF;
822822

823-
if (!is_byte_a_type(type1)) {
823+
if (!is_byte_a_type(type1)
824+
|| wasm_is_type_multi_byte_type(type1)) {
824825
p--;
825826
read_leb_uint32(p, p_end, type_idx);
826827
if (!check_type_index(module, module->type_count, type_idx,

0 commit comments

Comments
 (0)