Fix some issues reported by CodeQL (#3064)
Refer to https://github.com/bytecodealliance/wasm-micro-runtime/pull/2812 and https://github.com/bytecodealliance/wasm-micro-runtime/security/code-scanning?query=pr%3A2812+is%3Aopen
This commit is contained in:
@ -2013,7 +2013,8 @@ copy_buffer_to_iovec_app(wasm_module_inst_t module_inst, uint8 *buf_begin,
|
||||
}
|
||||
|
||||
if (buf >= buf_begin + buf_size
|
||||
|| buf + data->buf_len < buf /* integer overflow */
|
||||
/* integer overflow */
|
||||
|| data->buf_len > UINTPTR_MAX - (uintptr_t)buf
|
||||
|| buf + data->buf_len > buf_begin + buf_size
|
||||
|| size_to_copy == 0) {
|
||||
break;
|
||||
|
||||
@ -787,7 +787,7 @@ wasm_cluster_dup_c_api_imports(WASMModuleInstanceCommon *module_inst_dst,
|
||||
{
|
||||
/* workaround about passing instantiate-linking information */
|
||||
CApiFuncImport **new_c_api_func_imports = NULL;
|
||||
CApiFuncImport *c_api_func_imports;
|
||||
CApiFuncImport *c_api_func_imports = NULL;
|
||||
uint32 import_func_count = 0;
|
||||
uint32 size_in_bytes = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user