[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
- [GNUnet-SVN] [gnurl] 96/254: docs/opts: 23 more man pages now have examples, (continued)
- [GNUnet-SVN] [gnurl] 96/254: docs/opts: 23 more man pages now have examples, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 110/254: RELEASE-NOTES: synced with e3f84efc32d6b01a, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 117/254: tests: updated for modified fake random, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 194/254: CURLOPT_STREAM_DEPENDS.3: typo, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 124/254: tests: remove superfluous test 1399, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 131/254: multi: remove leftover debug infof() calls from e9fd794a6, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 51/254: tool: Fix missing prototype warnings for CURL_DOES_CONVERSIONS, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 43/254: unit1604: fixed indentation, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 220/254: CONTRIBUTE.md: mention tests done on pull requests, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 141/254: man pages: fix example syntax errors, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 137/254: url.c: add a compile-time check that CURL_MAX_WRITE_SIZE is large enough,
gnunet <=
- [GNUnet-SVN] [gnurl] 133/254: tests: made a couple of prechecks consistent with others, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 210/254: mbedtls: make TU-local variable static, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 243/254: gitignore: ignore all vim swap files, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 68/254: sendf: remove use of BUFSIZE from debug data conversions, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 197/254: examples/externalsocket.c: s/closesocket/closecb, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 201/254: typecheck-gcc.h: check CURLINFO_TLS_SSL_PTR and CURLINFO_TLS_SESSION, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 253/254: release: 7.54.1, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 97/254: docs/opts: 24 more man pages now have examples, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 74/254: testpart: remove _MPRINTF_REPLACE, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 193/254: CURLOPT_FNMATCH_FUNCTION.3: also modified example to avoid fcpp issues, gnunet, 2017/06/17