mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
Curl_socket_check: add extra check to avoid integer overflow
This commit is contained in:
parent
d18c546454
commit
9aa2afc3a5
@ -165,6 +165,12 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
|
|||||||
int r;
|
int r;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#if SIZEOF_LONG != SIZEOF_INT
|
||||||
|
/* wrap-around precaution */
|
||||||
|
if(timeout_ms >= INT_MAX)
|
||||||
|
timeout_ms = INT_MAX;
|
||||||
|
#endif
|
||||||
|
|
||||||
if((readfd0 == CURL_SOCKET_BAD) && (readfd1 == CURL_SOCKET_BAD) &&
|
if((readfd0 == CURL_SOCKET_BAD) && (readfd1 == CURL_SOCKET_BAD) &&
|
||||||
(writefd == CURL_SOCKET_BAD)) {
|
(writefd == CURL_SOCKET_BAD)) {
|
||||||
/* no sockets, just wait */
|
/* no sockets, just wait */
|
||||||
|
Loading…
Reference in New Issue
Block a user