]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed useless checks for guaranteed-defined pointers.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 27 Dec 2012 17:58:29 +0000 (18:58 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 27 Dec 2012 17:58:29 +0000 (18:58 +0100)
Detected by Coverity Scan. Defects 740936 and 740937.

src/http.cc
src/url.cc

index 71db3ead50b8c019c9504494215e4c8d249dc779..9fc69d014c1fb838e060709e2e3bbacdd58bca4a 100644 (file)
@@ -1779,7 +1779,7 @@ HttpStateData::httpBuildRequestHeader(HttpRequest * request,
 
     /* append Authorization if known in URL, not in header and going direct */
     if (!hdr_out->has(HDR_AUTHORIZATION)) {
-        if (!request->flags.proxying && request->login && *request->login) {
+        if (!request->flags.proxying && request->login[0] != '\0') {
             httpHeaderPutStrf(hdr_out, HDR_AUTHORIZATION, "Basic %s",
                               old_base64_encode(request->login));
         }
index d39a3275c94f7048705fc3cc91ae5e1e23fe9b55..e740ec5dc00554b947e90a967a1075f4bc0b6a59 100644 (file)
@@ -354,7 +354,7 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request)
         }
 
         // Bug 3183 sanity check: If scheme is present, host must be too.
-        if (protocol != AnyP::PROTO_NONE && (host == NULL || *host == '\0')) {
+        if (protocol != AnyP::PROTO_NONE && host[0] == '\0') {
             debugs(23, DBG_IMPORTANT, "SECURITY ALERT: Missing hostname in URL '" << url << "'. see access.log for details.");
             return NULL;
         }