summaryrefslogtreecommitdiff
path: root/lib/urlapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/urlapi.c')
-rw-r--r--lib/urlapi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c
index c53e52343..18a6076ff 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -499,8 +499,12 @@ static CURLUcode parse_port(struct Curl_URL *u, char *hostname)
(']' == endbracket)) {
/* this is a RFC2732-style specified IP-address */
portptr = &hostname[len];
- if (*portptr != ':')
- return CURLUE_MALFORMED_INPUT;
+ if(*portptr) {
+ if(*portptr != ':')
+ return CURLUE_MALFORMED_INPUT;
+ }
+ else
+ portptr = NULL;
}
else
portptr = strchr(hostname, ':');