curl: cap the maximum allowed values for retry time arguments

... to avoid integer overflows later when multiplying with 1000 to
convert seconds to milliseconds.

Added test 1269 to verify.

Reported-by: Jason Lee
Closes #4166
This commit is contained in:
Daniel Stenberg 2019-07-29 22:10:13 +02:00
parent d23e87d551
commit db0a0dfb0e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 61 additions and 4 deletions

34
tests/data/test1269 Normal file
View file

@ -0,0 +1,34 @@
<testcase>
<info>
<keywords>
--retry-delay
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<name>
too large --retry-delay value
</name>
<command>
--retry 3 --retry-delay 9223372036854776 http://%HOSTIP:%HTTPPORT/1269
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
2
</errorcode>
</verify>
</testcase>