summaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 22956a20f..06c5f5871 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -60,6 +60,13 @@ CURLcode Curl_setstropt(char **charp, const char *s)
if(s) {
char *str = strdup(s);
+ if(str) {
+ size_t len = strlen(str);
+ if(len > CURL_MAX_INPUT_LENGTH) {
+ free(str);
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+ }
+ }
if(!str)
return CURLE_OUT_OF_MEMORY;