From: Amos Jeffries Date: Wed, 30 May 2012 10:59:01 +0000 (-0600) Subject: Bug 3233: Invalid URL accepted with url host is white spaces X-Git-Tag: BumpSslServerFirst.take09~3^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2ab59a;p=thirdparty%2Fsquid.git Bug 3233: Invalid URL accepted with url host is white spaces --- diff --git a/src/url.cc b/src/url.cc index c93a13931f..44876fe144 100644 --- a/src/url.cc +++ b/src/url.cc @@ -270,7 +270,8 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request) /* Then everything until first /; thats host (and port; which we'll look for here later) */ // bug 1881: If we don't get a "/" then we imply it was there // bug 3074: We could just be given a "?" or "#". These also imply "/" - for (dst = host; i < l && *src != '/' && *src != '?' && *src != '#' && *src != '\0'; i++, src++, dst++) { + // bug 3233: whitespace is also a hostname delimiter. + for (dst = host; i < l && *src != '/' && *src != '?' && *src != '#' && *src != '\0' && !xisspace(*src); i++, src++, dst++) { *dst = *src; }