diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-04-15 10:27:20 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-04-23 15:57:23 +0200 |
commit | a96c7529eb31498a464910935a7d1a5e88ce3914 (patch) | |
tree | fbdbc3fbdcd5eb701cdd7946e93edaa46d48cf77 /lib/socks.c | |
parent | b1b96926148758c6a8de0898269c11b0e555ed66 (diff) | |
download | curl-a96c7529eb31498a464910935a7d1a5e88ce3914.tar.gz |
select: make Curl_socket_check take timediff_t timeout
Coverity found CID 1461718:
Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms >
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".
Closes #5240
Diffstat (limited to 'lib/socks.c')
-rw-r--r-- | lib/socks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/socks.c b/lib/socks.c index dfd944ef3..18affbc96 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -68,9 +68,9 @@ int Curl_blockread_all(struct connectdata *conn, /* connection data */ result = CURLE_OPERATION_TIMEDOUT; break; } - if(!timeout_ms || timeout_ms > TIME_T_MAX) + if(!timeout_ms) timeout_ms = TIME_T_MAX; - if(SOCKET_READABLE(sockfd, (time_t)timeout_ms) <= 0) { + if(SOCKET_READABLE(sockfd, timeout_ms) <= 0) { result = ~CURLE_OK; break; } |