Fix issue of wasm/aot file malformed format (#853)
Fix possible integer overflow unchecked issue when checking wasm/aot file format.
This commit is contained in:
@ -90,7 +90,7 @@ static bool
|
||||
check_buf(const uint8 *buf, const uint8 *buf_end, uint32 length,
|
||||
char *error_buf, uint32 error_buf_size)
|
||||
{
|
||||
if (buf + length > buf_end) {
|
||||
if (buf + length < buf || buf + length > buf_end) {
|
||||
set_error_buf(error_buf, error_buf_size, "unexpect end");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user