summaryrefslogtreecommitdiff
path: root/src/tool_paramhlp.h
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_paramhlp.h
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_paramhlp.h')
-rw-r--r--src/tool_paramhlp.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tool_paramhlp.h b/src/tool_paramhlp.h
index cdfbacf3f..854f52256 100644
--- a/src/tool_paramhlp.h
+++ b/src/tool_paramhlp.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -33,8 +33,7 @@ void cleanarg(char *str);
ParameterError str2num(long *val, const char *str);
ParameterError str2unum(long *val, const char *str);
-ParameterError str2double(double *val, const char *str);
-ParameterError str2udouble(double *val, const char *str);
+ParameterError str2udouble(double *val, const char *str, long max);
long proto2num(struct OperationConfig *config, long *val, const char *str);