hurl

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7b754ee4801e3fada177b6ade9d3144a126da8a5
parent e8e1e1a7d09c614b57fac5070eb5c28822c948ba
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 12 Mar 2021 22:33:04 +0100

validate value of -t timeout option

Diffstat:
Mhurl.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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;