diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2017-05-13 22:54:59 +0200 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2017-05-13 23:21:27 +0200 |
commit | d836c9fee4bbef249dc7bf281336fb41eb3b77c7 (patch) | |
tree | 9cacfac0b0e7c044d1dabaf946ab3d0e9a1dbdb7 /lib/url.c | |
parent | b1fa80b84facb94a667a6bfaa99476a161285b0d (diff) | |
download | curl-d836c9fee4bbef249dc7bf281336fb41eb3b77c7.tar.gz |
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.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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. */ |