validate value of -t timeout option - hurl - Gopher/HTTP/HTTPS file grabber (HTM) git clone git://git.codemadness.org/hurl (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 7b754ee4801e3fada177b6ade9d3144a126da8a5 (DIR) parent e8e1e1a7d09c614b57fac5070eb5c28822c948ba (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 12 Mar 2021 22:33:04 +0100 validate value of -t timeout option Diffstat: M hurl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- (DIR) diff --git a/hurl.c b/hurl.c @@ -46,7 +46,7 @@ static const char *config_headers = ""; /* max response size in bytes, 0 is unlimited */ static size_t config_maxresponsesiz = 0; /* time-out in seconds */ -static time_t config_timeout = 0; +static long long config_timeout = 0; /* legacy ciphers? */ static int config_legacy = 0; /* parsed uri */ @@ -670,7 +670,7 @@ main(int argc, char **argv) case 't': /* timeout */ errno = 0; l = strtoll(EARGF(usage()), &end, 10); - if (errno || *end != '\0' || l < 0) + if (errno || *end != '\0' || l < 0 || l >= 65535) usage(); config_timeout = l; break;