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:
@ -3134,8 +3134,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
|
||||
p += 8;
|
||||
while (p < p_end) {
|
||||
read_uint32(p, p_end, section_type);
|
||||
if (section_type <= AOT_SECTION_TYPE_SIGANATURE
|
||||
|| section_type == AOT_SECTION_TYPE_TARGET_INFO) {
|
||||
if (section_type <= AOT_SECTION_TYPE_SIGANATURE) {
|
||||
read_uint32(p, p_end, section_size);
|
||||
CHECK_BUF(p, p_end, section_size);
|
||||
if (section_type == AOT_SECTION_TYPE_TARGET_INFO) {
|
||||
@ -3150,7 +3149,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (section_type > AOT_SECTION_TYPE_SIGANATURE) {
|
||||
else { /* section_type > AOT_SECTION_TYPE_SIGANATURE */
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"resolve execute mode failed");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user