From 3cce6fdaacfaee598707e2fc135b608cb6c453b8 Mon Sep 17 00:00:00 2001 From: Zhenwei Jin <109658203+kylo5aby@users.noreply.github.com> Date: Mon, 12 May 2025 10:21:45 +0800 Subject: [PATCH] avoid access null pointer (#4262) --- core/iwasm/interpreter/wasm_loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index 13fd61e7c..8fbfea36b 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -820,7 +820,8 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end, #else cur_value.gc_obj = NULL_REF; - if (!is_byte_a_type(type1)) { + if (!is_byte_a_type(type1) + || wasm_is_type_multi_byte_type(type1)) { p--; read_leb_uint32(p, p_end, type_idx); if (!check_type_index(module, module->type_count, type_idx,