]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1022: bad credentials fetch (no user)
authorserassio <>
Sun, 11 Dec 2005 17:00:47 +0000 (17:00 +0000)
committerserassio <>
Sun, 11 Dec 2005 17:00:47 +0000 (17:00 +0000)
This problem is triggered only when using the --enable-ntlm-fail-open
configure option.

helpers/ntlm_auth/SMB/libntlmssp.c

index 30c88bf7c23eb6e35491ddc49a8d71d9386e35af..d964b2eedce27684c0e0600a9f250d99cfba27f3 100644 (file)
@@ -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;
 }