Fairly rare occurances hard to hit but still possible. Any one of these
could crash Squid in their particular circumstances.
Detected by Coverity Scan. Issue
1187972,
1187973,
1232097,
1241502.
if ((static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->authenticateProgram) && authDigestNonceLastRequest(nonce)) {
flags.authinfo_sent = true;
Auth::Digest::User *digest_user = dynamic_cast<Auth::Digest::User *>(user().getRaw());
+ if (!digest_user)
+ return;
+
digest_nonce_h *nextnonce = digest_user->currentNonce();
if (!nextnonce || authDigestNonceLastRequest(nonce)) {
nextnonce = authenticateDigestNonceNew();
}
debugs(84, DBG_DATA, "placeholder: '" << r->placeholder <<
- "', " << Raw("buf", buf, strlen(buf)));
+ "', " << Raw("buf", buf, (!buf?0:strlen(buf))));
}
/**
clientStreamNode *node = context->getClientReplyContext();
Must(node);
clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
+ Must(repContext);
// We cannot relay FTP scode/reason via HTTP-specific ErrorState.
// TODO: When/if ErrorState can handle native FTP errors, use it instead.
break;
case 'I':
- if ((interval = atoi(optarg) * 1000) <= 0) {
+ if (!optarg) {
+ std::cerr << "ERROR: -I ping interval missing parameter." << std::endl;
+ usage();
+ } else if ((interval = atoi(optarg) * 1000) <= 0) {
std::cerr << "ERROR: -I ping interval out of range (0-" << (INT_MAX/1000) << ")." << std::endl;
usage();
}