From: Amos Jeffries Date: Tue, 5 Jun 2012 09:08:03 +0000 (-0600) Subject: Bug 3233: Invalid URL accepted with url host is white spaces X-Git-Tag: SQUID_3_1_20~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80cbdf2512e5794195389d4a8271fdfc6fac37a0;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 6222fe729a..3e3e395444 100644 --- a/src/url.cc +++ b/src/url.cc @@ -269,7 +269,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; }