summaryrefslogtreecommitdiff
path: root/lib/select.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-04-15 10:27:20 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-04-23 15:57:23 +0200
commita96c7529eb31498a464910935a7d1a5e88ce3914 (patch)
treefbdbc3fbdcd5eb701cdd7946e93edaa46d48cf77 /lib/select.c
parentb1b96926148758c6a8de0898269c11b0e555ed66 (diff)
downloadcurl-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/select.c')
-rw-r--r--lib/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/select.c b/lib/select.c
index 857e7f698..d91b20a4b 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -201,7 +201,7 @@ int Curl_select(curl_socket_t maxfd,
int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
curl_socket_t readfd1,
curl_socket_t writefd, /* socket to write to */
- time_t timeout_ms) /* milliseconds to wait */
+ timediff_t timeout_ms) /* milliseconds to wait */
{
#ifdef HAVE_POLL_FINE
struct pollfd pfd[3];
@@ -333,7 +333,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
curl_socket_t is unsigned in such cases and thus -1 is the largest
value).
*/
- r = Curl_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms);
+ r = Curl_select(maxfd, &fds_read, &fds_write, &fds_err, (time_t)timeout_ms);
if(r < 0)
return -1;