]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Coverity detected a code-path in helpers/ntlm_auth/SMB/ntlm_auth.c
authoramosjeffries <>
Thu, 2 Aug 2007 08:52:01 +0000 (08:52 +0000)
committeramosjeffries <>
Thu, 2 Aug 2007 08:52:01 +0000 (08:52 +0000)
 that dereferences NULL credentials.
Added an assert to check for the condition in real-use.
Possibly need to add a default case to the switch on line 360.

helpers/ntlm_auth/SMB/ntlm_auth.c

index cf987b90852f939d1c76e7638e1bf7e7568f5980..8355dd7e6184e1666a39f8c105b88d2ceadac966 100644 (file)
@@ -273,7 +273,7 @@ manage_request()
     ntlmhdr *fast_header;
     char buf[BUFFER_SIZE];
     const char *ch;
-    char *ch2, *decoded, *cred;
+    char *ch2, *decoded, *cred = NULL;
     int plen;
 
     if (fgets(buf, BUFFER_SIZE, stdin) == NULL) {
@@ -414,6 +414,7 @@ manage_request()
                    return;
                }
            }
+            assert(cred != NULL);
            lc(cred);           /* let's lowercase them for our convenience */
            SEND2("AF %s", cred);
            return;