Fix several issues reported by oss-fuzz (#3526)
- possible integer overflow in adjust_table_max_size: unsigned integer overflow: 2684354559 * 2 cannot be represented in type 'uint32' - limit max memory size in wasm_runtime_malloc - add more checks in aot loader - adjust compilation options
This commit is contained in:
@ -667,13 +667,11 @@
|
||||
#define WASM_ENABLE_FUZZ_TEST 0
|
||||
#endif
|
||||
|
||||
#ifndef WASM_MEM_ALLOC_MAX_SIZE
|
||||
#if WASM_ENABLE_FUZZ_TEST != 0
|
||||
#ifndef WASM_MEM_ALLOC_MAX_SIZE
|
||||
/* In oss-fuzz, the maximum RAM is ~2.5G */
|
||||
#define WASM_MEM_ALLOC_MAX_SIZE (2U * 1024 * 1024 * 1024)
|
||||
#else
|
||||
#define WASM_MEM_ALLOC_MAX_SIZE UINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
#endif /* WASM_ENABLE_FUZZ_TEST != 0 */
|
||||
|
||||
#endif /* end of _CONFIG_H_ */
|
||||
|
||||
Reference in New Issue
Block a user