From: Francesco Chemolli Date: Thu, 27 Dec 2012 17:58:29 +0000 (+0100) Subject: Removed useless checks for guaranteed-defined pointers. X-Git-Tag: SQUID_3_4_0_1~415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff8b6bcf9f111af8e6892a8f8cfafbc2fb923d46;p=thirdparty%2Fsquid.git Removed useless checks for guaranteed-defined pointers. Detected by Coverity Scan. Defects 740936 and 740937. --- diff --git a/src/http.cc b/src/http.cc index 71db3ead50..9fc69d014c 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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)); } diff --git a/src/url.cc b/src/url.cc index d39a3275c9..e740ec5dc0 100644 --- a/src/url.cc +++ b/src/url.cc @@ -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; }