[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READAB
From: |
gnunet |
Subject: |
[gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READABLE |
Date: |
Thu, 30 Apr 2020 16:07:42 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 53f407082746e7e57534595957616b8d56905ad5
Author: Jay Satiro <address@hidden>
AuthorDate: Tue Apr 7 17:18:05 2020 -0400
lib: fix conversion warnings for SOCKET_WRITABLE/READABLE
- If loss of data may occur converting a timediff_t to time_t and
the time value is > TIME_T_MAX then treat it as TIME_T_MAX.
This is a follow-up to 8843678 which removed the (time_t) typecast
from the macros so that conversion warnings could be identified.
Closes https://github.com/curl/curl/pull/5199
---
lib/socks.c | 4 +++-
lib/vtls/schannel.c | 5 +++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/socks.c b/lib/socks.c
index 37099130e..5dd83631c 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -68,7 +68,9 @@ int Curl_blockread_all(struct connectdata *conn, /*
connection data */
result = CURLE_OPERATION_TIMEDOUT;
break;
}
- if(SOCKET_READABLE(sockfd, timeleft) <= 0) {
+ if(timeleft > TIME_T_MAX)
+ timeleft = TIME_T_MAX;
+ if(SOCKET_READABLE(sockfd, (time_t)timeleft) <= 0) {
result = ~CURLE_OK;
break;
}
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 8bf598c07..cb70d5309 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1645,8 +1645,9 @@ schannel_send(struct connectdata *conn, int sockindex,
written = -1;
break;
}
-
- what = SOCKET_WRITABLE(conn->sock[sockindex], timeleft);
+ if(timeleft > TIME_T_MAX)
+ timeleft = TIME_T_MAX;
+ what = SOCKET_WRITABLE(conn->sock[sockindex], (time_t)timeleft);
if(what < 0) {
/* fatal error */
failf(conn->data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 209/264: tests: move pingpong server to dynamic listening port, (continued)
- [gnurl] 209/264: tests: move pingpong server to dynamic listening port, gnunet, 2020/04/30
- [gnurl] 184/264: tests: add the mqtt test server mqttd, gnunet, 2020/04/30
- [gnurl] 210/264: test1028: make it run on dynamic FTP server port, gnunet, 2020/04/30
- [gnurl] 211/264: test1055: make it work with dynamic FTP port, gnunet, 2020/04/30
- [gnurl] 176/264: appveyor: completely disable tests that fail to timeout early, gnunet, 2020/04/30
- [gnurl] 139/264: release-notes: output trailing references sorted numerically, gnunet, 2020/04/30
- [gnurl] 244/264: select: make Curl_socket_check take timediff_t timeout, gnunet, 2020/04/30
- [gnurl] 150/264: release-notes: fix the initial reference list output, gnunet, 2020/04/30
- [gnurl] 144/264: http: allow Curl_add_buffer_send() to do a short first send by force, gnunet, 2020/04/30
- [gnurl] 262/264: RELEASE-NOTES: 7.70.0, gnunet, 2020/04/30
- [gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READABLE,
gnunet <=
- [gnurl] 182/264: mqtt: add new experimental protocol, gnunet, 2020/04/30
- [gnurl] 145/264: http: don't consider upload done if the request isn't completely sent off, gnunet, 2020/04/30
- [gnurl] 181/264: TODO: Consider convenience options for JSON and XML?, gnunet, 2020/04/30
- [gnurl] 143/264: connect: store connection info for QUIC connections, gnunet, 2020/04/30
- [gnurl] 148/264: runtests: provide nicer errormsg when protocol "dump" file is empty, gnunet, 2020/04/30
- [gnurl] 258/264: nss: check for PK11_CreateDigestContext() returning NULL, gnunet, 2020/04/30
- [gnurl] 151/264: runtests: fix warning about using an undefined variable, gnunet, 2020/04/30
- [gnurl] 153/264: url: allow non-HTTPS altsvc-matching for debug builds, gnunet, 2020/04/30
- [gnurl] 174/264: schannel: Fix blocking timeout logic, gnunet, 2020/04/30
- [gnurl] 123/264: test1566: verify --etag-compare that gets a 304 back, gnunet, 2020/04/30