Fix issues detected by Coverity (#1154)

wasm_c_api.c: add more checks, fix LOG_WARNING invalid specifier
aot_emit_aot_file: fix strncpy max size length to copy
posix.c: fix potential socket not close issue
wasm-c-api samples: add return value checks for fseek/ftell
cJSON.c: remove dead code
This commit is contained in:
liang.he
2022-05-07 18:53:02 +08:00
committed by GitHub
parent 21e59d883f
commit ed512c6867
15 changed files with 294 additions and 98 deletions

View File

@ -2104,7 +2104,7 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
}
strncpy(obj_data->target_info.arch, comp_ctx->target_arch,
sizeof(obj_data->target_info.arch));
sizeof(obj_data->target_info.arch) - 1);
return true;
}