]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3423: access violation in URL parser
authorJan Klemkow <j.klemkow@wemelug.de>
Thu, 24 Nov 2011 11:11:42 +0000 (04:11 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Nov 2011 11:11:42 +0000 (04:11 -0700)
src/url.cc

index 79fab548cb37c3802de0b4853eaade1b9ffb6784..e6a855ac303ffac1465b0844c4183edfeb5b36a0 100644 (file)
@@ -249,8 +249,7 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request)
         *dst = '\0';
 
         /* Then its :// */
-        /* (XXX yah, I'm not checking we've got enough data left before checking the array..) */
-        if (*src != ':' || *(src + 1) != '/' || *(src + 2) != '/')
+        if ((i+3) > l || *src != ':' || *(src + 1) != '/' || *(src + 2) != '/')
             return NULL;
         i += 3;
         src += 3;