summaryrefslogtreecommitdiff
path: root/src/tool_helpers.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-08-06 20:10:40 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-08-07 09:38:45 +0200
commit5c7455fe7691a18e0f6a85ebe26aae861ccc5284 (patch)
treea9470b75e0d35b584557c9873885ea68a1c54cd5 /src/tool_helpers.c
parent453e7a7a03a2cec749abd3878a48e728c515cca7 (diff)
downloadcurl-5c7455fe7691a18e0f6a85ebe26aae861ccc5284.tar.gz
curl: detect and bail out early on parameter integer overflows
Make the number parser aware of the maximum limit curl accepts for a value and return an error immediately if larger, instead of running an integer overflow later. Fixes #1730 Closes #1736
Diffstat (limited to 'src/tool_helpers.c')
-rw-r--r--src/tool_helpers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tool_helpers.c b/src/tool_helpers.c
index 3d2dbe3ac..b3a9516a8 100644
--- a/src/tool_helpers.c
+++ b/src/tool_helpers.c
@@ -64,6 +64,8 @@ const char *param2text(int res)
return "out of memory";
case PARAM_NO_PREFIX:
return "the given option can't be reversed with a --no- prefix";
+ case PARAM_NUMBER_TOO_LARGE:
+ return "too large number";
default:
return "unknown error";
}