]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Coverity detected. inconsistent error detection on StoreIOBUffer
authorAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 6 Oct 2008 11:34:25 +0000 (05:34 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Mon, 6 Oct 2008 11:34:25 +0000 (05:34 -0600)
Audit reveals only one of several callers which might set negative length
state were checking for it and setting error flag properly.

Makes more sense for the StoreIOBuffer constructor to do its own
error state detection with information than to offload on callers.

helpers/ntlm_auth/fakeauth/fakeauth_auth.c

index e30170a846e201fa7b8fe408e0a78a568cde2de0..18c75fc3bd8773e9c7f5bd38df93f9864f857678 100755 (executable)
@@ -428,7 +428,10 @@ main(int argc, char *argv[])
            } else
                SEND2("TT %s", data);
        } else if (strncasecmp(buf, "KK ", 3) == 0) {
-           if (!ntlmCheckHeader((ntlmhdr *) decoded, NTLM_AUTHENTICATE)) {
+            if(!decoded) {
+                SEND2("BH received KK with no data! user=%s", user);
+            }
+           else if (!ntlmCheckHeader((ntlmhdr *) decoded, NTLM_AUTHENTICATE)) {
                if (!ntlmDecodeAuth((struct ntlm_authenticate *) decoded, user, 256)) {
                    lc(user);
                    if (strip_domain_enabled) {