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:
@ -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) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user