Skip to content

Commit cbb6d03

Browse files
authored
add validtion for parent_type_idx (#4550)
1 parent feecaf6 commit cbb6d03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/iwasm/aot/aot_loader.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,12 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
18111811
set_error_buf(error_buf, error_buf_size, "invalid rec_idx");
18121812
goto fail;
18131813
}
1814+
if (parent_type_idx >= i) {
1815+
set_error_buf(
1816+
error_buf, error_buf_size,
1817+
"parent type index must be smaller than current type index");
1818+
goto fail;
1819+
}
18141820
#endif
18151821
if (type_flag == WASM_TYPE_FUNC) {
18161822
AOTFuncType *func_type;

0 commit comments

Comments
 (0)