diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 135ee8dad151..8cb3536a46c5 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -427,7 +427,7 @@ fetchParseURL(const char *URL) goto ouch; } } - if (n < 1 || n > IPPORT_MAX) + if (p != q && (n < 1 || n > IPPORT_MAX)) goto ouch; u->port = n; p = q;