mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-11-27 10:00:59 +00:00
add validation for rec indices in aot loader (#4520)
This commit is contained in:
parent
aad1866260
commit
33eff933c0
|
|
@ -1805,7 +1805,12 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
|
||||||
read_uint32(buf, buf_end, parent_type_idx);
|
read_uint32(buf, buf_end, parent_type_idx);
|
||||||
read_uint16(buf, buf_end, rec_count);
|
read_uint16(buf, buf_end, rec_count);
|
||||||
read_uint16(buf, buf_end, rec_idx);
|
read_uint16(buf, buf_end, rec_idx);
|
||||||
|
#if WASM_ENABLE_AOT_VALIDATOR != 0
|
||||||
|
if (rec_idx > i) {
|
||||||
|
set_error_buf(error_buf, error_buf_size, "invalid rec_idx");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (type_flag == WASM_TYPE_FUNC) {
|
if (type_flag == WASM_TYPE_FUNC) {
|
||||||
AOTFuncType *func_type;
|
AOTFuncType *func_type;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user