]> 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>
Tue, 5 Jun 2012 09:08:03 +0000 (03:08 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 5 Jun 2012 09:08:03 +0000 (03:08 -0600)
src/url.cc

index 6222fe729ac40b49bc883437cca9abcf0e9702f5..3e3e395444aa3edc6fdf06b0d6f440195d9d9fa8 100644 (file)
@@ -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;
         }