diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-12-03 15:56:58 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-12-03 22:58:41 +0100 |
commit | 92d1aee8b16bb5aa416368cb54ded732cc39c407 (patch) | |
tree | 5aae76f0c95442018560049f665760ec2a032a7c /lib/urlapi.c | |
parent | f67b4d37b7df7772f8a0b0a0e05935161f314cc7 (diff) | |
download | curl-92d1aee8b16bb5aa416368cb54ded732cc39c407.tar.gz |
urlapi: accept port number zero
This is a regression since 7.62.0 (fb30ac5a2d).
Updated test 1560 accordingly
Reported-by: Brad Fitzpatrick
Fixes #8090
Closes #8091
Diffstat (limited to 'lib/urlapi.c')
-rw-r--r-- | lib/urlapi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c index 372ffe50a..d88db2978 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -605,9 +605,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname, port = strtol(portptr + 1, &rest, 10); /* Port number must be decimal */ - if((port <= 0) || (port > 0xffff)) - /* Single unix standard says port numbers are 16 bits long, but we don't - treat port zero as OK. */ + if(port > 0xffff) return CURLUE_BAD_PORT_NUMBER; if(rest[0]) |