]> git.ipfire.org Git - thirdparty/curl.git/commit
setopt: avoid integer overflows when setting millsecond values
authorDaniel Stenberg <daniel@haxx.se>
Tue, 3 Oct 2017 15:00:18 +0000 (17:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 16 Oct 2017 07:23:19 +0000 (09:23 +0200)
commit172ce9cc19a72342243c0cb06b2144ac16a84f89
tree97753efe9744ecc85c063e049a7f21f2a32db4db
parent4440b6ad575385b433dc4b8a28ef80000aa95f7f
setopt: avoid integer overflows when setting millsecond values

... that are multiplied by 1000 when stored.

For 32 bit long systems, the max value accepted (2147483 seconds) is >
596 hours which is unlikely to ever be set by a legitimate application -
and previously it didn't work either, it just caused undefined behavior.

Also updated the man pages for these timeout options to mention the
return code.

Closes #1938
docs/libcurl/opts/CURLOPT_CONNECTTIMEOUT.3
docs/libcurl/opts/CURLOPT_FTP_RESPONSE_TIMEOUT.3
docs/libcurl/opts/CURLOPT_TIMEOUT.3
lib/url.c