From 5fc28510a4664f46459d9a40187d81cc08571e60 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 29 Apr 2019 08:00:49 +0200 Subject: CURL_MAX_INPUT_LENGTH: largest acceptable string input size This limits all accepted input strings passed to libcurl to be less than CURL_MAX_INPUT_LENGTH (8000000) bytes, for these API calls: curl_easy_setopt() and curl_url_set(). The 8000000 number is arbitrary picked and is meant to detect mistakes or abuse, not to limit actual practical use cases. By limiting the acceptable string lengths we also reduce the risk of integer overflows all over. NOTE: This does not apply to `CURLOPT_POSTFIELDS`. Test 1559 verifies. Closes #3805 --- tests/data/test1559 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/data/test1559 (limited to 'tests/data/test1559') diff --git a/tests/data/test1559 b/tests/data/test1559 new file mode 100644 index 000000000..cbed6fbcc --- /dev/null +++ b/tests/data/test1559 @@ -0,0 +1,44 @@ + + + +CURLOPT_URL + + + + + + + + +none + + +# require HTTP so that CURLOPT_POSTFIELDS works as assumed + +http + + +lib1559 + + + +Set excessive URL lengths + + + +# +# Verify that the test runs to completion without crashing + + +0 + + +CURLOPT_URL 10000000 bytes URL == 43 +CURLOPT_POSTFIELDS 10000000 bytes data == 0 +CURLUPART_URL 10000000 bytes URL == 3 +CURLUPART_SCHEME 10000000 bytes scheme == 3 +CURLUPART_USER 10000000 bytes user == 3 + + + + -- cgit v1.2.3