Skip to content

Commit f8d5de8

Browse files
committed
add bounds checking to prevent ref_type_map_count
Signed-off-by: zhenweijin <[email protected]>
1 parent 6b51c61 commit f8d5de8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/iwasm/interpreter/wasm_loader.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3959,6 +3959,11 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
39593959
total_size, error_buf, error_buf_size))) {
39603960
return false;
39613961
}
3962+
if (ref_type_map_count > UINT16_MAX) {
3963+
set_error_buf(error_buf, error_buf_size,
3964+
"local count too large");
3965+
return false;
3966+
}
39623967
func->local_ref_type_map_count = ref_type_map_count;
39633968
}
39643969
#endif

0 commit comments

Comments
 (0)