]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2411: fakeauth_auth is crashing during NTLM auth
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 16 Jul 2008 12:54:20 +0000 (00:54 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 16 Jul 2008 12:54:20 +0000 (00:54 +1200)
A NULL abort test was missing from the Squid-3 version.

helpers/ntlm_auth/fakeauth/fakeauth_auth.c

index e557d0d9124a7a1ddb6202b42b0032cb2563000c..e30170a846e201fa7b8fe408e0a78a568cde2de0 100644 (file)
@@ -299,9 +299,12 @@ ntlmDecodeAuth(struct ntlm_authenticate *auth, char *buf, size_t size)
     buf += (s - 1);
     *buf++ = '\\';             /* Using \ is more consistent with MS-proxy */
 
-    p = ntlmGetString(&auth->hdr, &auth->user, auth->flags);
+    if( (p = ntlmGetString(&auth->hdr, &auth->user, auth->flags)) == NULL)
+        return 1;
+
     if ((s = strlen(p) + 1) >= size)
        return 1;
+
     while (*p)
        *buf++ = (*p++);        //tolower