From a96c7529eb31498a464910935a7d1a5e88ce3914 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 15 Apr 2020 10:27:20 +0200 Subject: 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 --- lib/vtls/schannel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/vtls/schannel.c') diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index dce6242da..49659bb7a 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1645,9 +1645,9 @@ schannel_send(struct connectdata *conn, int sockindex, written = -1; break; } - if(!timeout_ms || timeout_ms > TIME_T_MAX) - timeout_ms = TIME_T_MAX; - what = SOCKET_WRITABLE(conn->sock[sockindex], (time_t)timeout_ms); + if(!timeout_ms) + timeout_ms = TIMEDIFF_T_MAX; + what = SOCKET_WRITABLE(conn->sock[sockindex], timeout_ms); if(what < 0) { /* fatal error */ failf(conn->data, "select/poll on SSL socket, errno: %d", SOCKERRNO); -- cgit v1.2.3