[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 33/150: Curl_range: add check to ensure "from <= to
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 33/150: Curl_range: add check to ensure "from <= to" |
Date: |
Fri, 30 Mar 2018 16:48:07 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 3f8a727611b9fb048c407ee865e6e3a3f3150c9c
Author: Max Dymond <address@hidden>
AuthorDate: Mon Jan 29 10:12:40 2018 +0000
Curl_range: add check to ensure "from <= to"
---
lib/curl_range.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/curl_range.c b/lib/curl_range.c
index e24215f4d..849e12fd3 100644
--- a/lib/curl_range.c
+++ b/lib/curl_range.c
@@ -36,7 +36,6 @@
CURLcode Curl_range(struct connectdata *conn)
{
curl_off_t from, to;
- curl_off_t totalsize = -1;
char *ptr;
char *ptr2;
struct Curl_easy *data = conn->data;
@@ -67,10 +66,16 @@ CURLcode Curl_range(struct connectdata *conn)
}
else {
/* X-Y */
- totalsize = to-from;
+ curl_off_t totalsize;
+
+ /* Ensure the range is sensible - to should follow from. */
+ if(from > to)
+ return CURLE_RANGE_ERROR;
+
+ totalsize = to - from;
if(totalsize == CURL_OFF_T_MAX)
- /* this is too big to increase, so bail out */
return CURLE_RANGE_ERROR;
+
data->req.maxdownload = totalsize + 1; /* include last byte */
data->state.resume_from = from;
DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 105/150: curl_share_setopt.3: connection cache is shared within multi handles, (continued)
- [GNUnet-SVN] [gnurl] 105/150: curl_share_setopt.3: connection cache is shared within multi handles, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 121/150: krb5: use nondeprecated functions, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 74/150: TODO fixed: Detect when called from within callbacks, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 149/150: release: 7.59.0, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 108/150: projects/README: remove reference to dead IDN link/package, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 136/150: readwrite: make sure excess reads don't go beyond buffer end, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 139/150: openldap: white space changes, fixed up the copyright years, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 112/150: docs/MANUAL: formfind.pl is not accessible on the site anymore, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 147/150: CURLOPT_COOKIEFILE.3: "-" as file name means stdin, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 141/150: http2: mark the connection for close on GOAWAY, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 33/150: Curl_range: add check to ensure "from <= to",
gnunet <=
- [GNUnet-SVN] [gnurl] 36/150: progress-bar.d: update to match implementation, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 41/150: parsedate: s/#if/#ifdef, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 53/150: curl_addrinfo.c: Allow Unix Domain Sockets to compile under Windows, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 46/150: formdata: use the mime-content type function, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 32/150: Curl_range: commonize FTP and FILE range handling, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 92/150: curl --version: show PSL if the run-time lib has it enabled, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 11/150: parsedate: fix date parsing for systems with 32 bit long, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 102/150: form.d: rephrased somewhat, added two example command lines, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 60/150: http_chunks: don't write chunks twice with CURLOPT_HTTP_TRANSFER_DECODING on, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 62/150: sha256: build with OpenSSL < 0.9.8 too, gnunet, 2018/03/30