]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Ignore HTCP packets with invalid URI
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 8 Jul 2017 09:58:09 +0000 (21:58 +1200)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 8 Jul 2018 14:04:24 +0000 (02:04 +1200)
src/htcp.cc

index c0241aa9620e5df97d951fb44c909abc784f93a5..55d08ffda0bc62ccd68ed957e576f063269af8e5 100644 (file)
@@ -749,9 +749,12 @@ htcpUnpackSpecifier(char *buf, int sz)
 
     s->request = HttpRequest::CreateFromUrlAndMethod(s->uri, method == Http::METHOD_NONE ? HttpRequestMethod(Http::METHOD_GET) : method);
 
-    if (s->request)
-        HTTPMSGLOCK(s->request);
+    if (!s->request) {
+        debugs(31, 3, "failed to create request. Invalid URI?");
+        return NULL;
+    }
 
+    HTTPMSGLOCK(s->request);
     return s;
 }