Skip to content

Commit

Permalink
net: sockets: tls: Fix invalid variable initialization
Browse files Browse the repository at this point in the history
The timeout variable in `dtls_rx()` was initialized improperly.

Coverity ID: 214219

Fixes zephyrproject-rtos#28161

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and jukkar committed Sep 9, 2020
1 parent bff0f95 commit 7242a80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/lib/sockets/sockets_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static int dtls_rx(void *ctx, unsigned char *buf, size_t len,
bool is_block = !((tls_ctx->flags & ZSOCK_MSG_DONTWAIT) ||
(zsock_fcntl(tls_ctx->sock, F_GETFL, 0) &
O_NONBLOCK));
int timeout = (dtls_timeout == 0U) ? -1 : timeout;
int timeout = (dtls_timeout == 0U) ? -1 : dtls_timeout;
uint32_t entry_time = k_uptime_get_32();
socklen_t addrlen = sizeof(struct sockaddr);
struct sockaddr addr;
Expand Down

0 comments on commit 7242a80

Please sign in to comment.