gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 137/254: url.c: add a compile-time check that CURL_


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 137/254: url.c: add a compile-time check that CURL_MAX_WRITE_SIZE is large enough
Date: Sat, 17 Jun 2017 16:52:49 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit d836c9fee4bbef249dc7bf281336fb41eb3b77c7
Author: Dan Fandrich <address@hidden>
AuthorDate: Sat May 13 22:54:59 2017 +0200

    url.c: add a compile-time check that CURL_MAX_WRITE_SIZE is large enough
    
    Some code (e.g. Curl_fillreadbuffer) assumes that this buffer is not
    exceedingly tiny and will break if it is. This same check is already
    done at run time in the CURLOPT_BUFFERSIZE option.
---
 docs/libcurl/opts/CURLOPT_BUFFERSIZE.3 | 3 ++-
 lib/url.c                              | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/libcurl/opts/CURLOPT_BUFFERSIZE.3 
b/docs/libcurl/opts/CURLOPT_BUFFERSIZE.3
index 5d9b065af..b4100e607 100644
--- a/docs/libcurl/opts/CURLOPT_BUFFERSIZE.3
+++ b/docs/libcurl/opts/CURLOPT_BUFFERSIZE.3
@@ -37,7 +37,8 @@ This is just treated as a request, not an order. You cannot 
be guaranteed to
 actually get the given size.
 
 This buffer size is by default \fICURL_MAX_WRITE_SIZE\fP (16kB). The maximum
-buffer size allowed to set is \fICURL_MAX_READ_SIZE\fP (512kB).
+buffer size allowed to be set is \fICURL_MAX_READ_SIZE\fP (512kB). The minimum
+buffer size allowed to be set is 1024.
 .SH DEFAULT
 CURL_MAX_WRITE_SIZE (16kB)
 .SH PROTOCOLS
diff --git a/lib/url.c b/lib/url.c
index 073c4331b..8e470b0e1 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -144,6 +144,15 @@ static unsigned int get_protocol_family(unsigned int 
protocol);
 #define READBUFFER_MAX  CURL_MAX_READ_SIZE
 #define READBUFFER_MIN  1024
 
+/* Some parts of the code (e.g. chunked encoding) assume this buffer has at
+ * more than just a few bytes to play with. Don't let it become too small or
+ * bad things will happen.
+ */
+#if READBUFFER_SIZE < READBUFFER_MIN
+# error READBUFFER_SIZE is too small
+#endif
+
+
 /*
  * Protocol table.
  */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]