From 5c7455fe7691a18e0f6a85ebe26aae861ccc5284 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 6 Aug 2017 20:10:40 +0200 Subject: 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 --- src/tool_helpers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tool_helpers.c') 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"; } -- cgit v1.2.3