From 96f62094551ebbf811d7539d26cd13a182039701 Mon Sep 17 00:00:00 2001 From: serassio <> Date: Sun, 11 Dec 2005 17:00:47 +0000 Subject: [PATCH] Bug #1022: bad credentials fetch (no user) This problem is triggered only when using the --enable-ntlm-fail-open configure option. --- helpers/ntlm_auth/SMB/libntlmssp.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.47.3