diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 8fdcc8e8752..df97bf486f9 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -426,7 +426,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;