From: Amos Jeffries Date: Wed, 16 Jul 2008 12:54:20 +0000 (+1200) Subject: Bug 2411: fakeauth_auth is crashing during NTLM auth X-Git-Tag: SQUID_3_1_0_1~49^2~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab6f8ebc0379286814fba70a3ae0a582ef124da7;p=thirdparty%2Fsquid.git Bug 2411: fakeauth_auth is crashing during NTLM auth A NULL abort test was missing from the Squid-3 version. --- diff --git a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c index e557d0d912..e30170a846 100644 --- a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c +++ b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c @@ -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