Fix issues reported by klocwork (#1060)

Fix issues reported by klocwork, fix host_tool compile error,
and update build script of benchmark jetstream
This commit is contained in:
Wenyong Huang
2022-03-24 17:34:22 +08:00
committed by GitHub
parent 7262aebf77
commit 5264ce4118
7 changed files with 31 additions and 13 deletions

View File

@ -224,6 +224,8 @@ on_rsp_byte_arrive(unsigned char ch, rsp_recv_context_t *ctx)
if (ctx->size_in_phase == 2) {
ctx->size_in_phase = 0;
bh_assert(ctx->receive_index >= 3);
if ((hex(ctx->receive_buffer[ctx->receive_index - 2]) << 4
| hex(ctx->receive_buffer[ctx->receive_index - 1]))
!= ctx->check_sum) {

View File

@ -2910,7 +2910,7 @@ wasi_ssp_sock_open(
error =
fd_determine_type_rights(sock, &wasi_type, &max_base, &max_inheriting);
if (error != __WASI_ESUCCESS) {
os_socket_close(ret);
os_socket_close(sock);
return error;
}
@ -2925,7 +2925,7 @@ wasi_ssp_sock_open(
error = fd_table_insert_fd(curfds, sock, wasi_type, max_base,
max_inheriting, sockfd);
if (error != __WASI_ESUCCESS) {
os_socket_close(ret);
os_socket_close(sock);
return error;
}