Detected by Coverity Scan. Defects 740936 and 740937.
/* 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));
}
}
// 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;
}