]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3233: Invalid URL accepted with url host is white spaces
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Jun 2012 11:06:45 +0000 (05:06 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Jun 2012 11:06:45 +0000 (05:06 -0600)
src/url.cc

index c93a13931f5d99d0179e8e7ccb6a5285d12bad66..44876fe144da240149ed86a1b21d40f213475473 100644 (file)
@@ -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;
         }