From: serassio <> Date: Sun, 11 Dec 2005 17:00:47 +0000 (+0000) Subject: Bug #1022: bad credentials fetch (no user) X-Git-Tag: SQUID_3_0_PRE4~460 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96f62094551ebbf811d7539d26cd13a182039701;p=thirdparty%2Fsquid.git Bug #1022: bad credentials fetch (no user) This problem is triggered only when using the --enable-ntlm-fail-open configure option. --- diff --git a/helpers/ntlm_auth/SMB/libntlmssp.c b/helpers/ntlm_auth/SMB/libntlmssp.c index 30c88bf7c2..d964b2eedc 100644 --- a/helpers/ntlm_auth/SMB/libntlmssp.c +++ b/helpers/ntlm_auth/SMB/libntlmssp.c @@ -178,14 +178,17 @@ fetch_credentials(ntlm_authenticate * auth, int auth_length) char *p = credentials; lstring tmp; tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->domain); + *p = '\0'; if (tmp.str == NULL) return NULL; memcpy(p, tmp.str, tmp.l); p += tmp.l; *p++ = '\\'; + *p = '\0'; tmp = ntlm_fetch_string((char *) auth, auth_length, &auth->user); if (tmp.str == NULL) return NULL; + memcpy(p, tmp.str, tmp.l); *(p + tmp.l) = '\0'; return credentials; }