summaryrefslogtreecommitdiff
path: root/source3/auth/pass_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/auth/pass_check.c')
-rw-r--r--source3/auth/pass_check.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c
index 8773804a38..27915bf499 100644
--- a/source3/auth/pass_check.c
+++ b/source3/auth/pass_check.c
@@ -599,7 +599,7 @@ return NT_STATUS_OK on correct match, appropriate error otherwise
NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *password,
int pwlen, bool (*fn) (const char *, const char *), bool run_cracker)
{
- pstring pass2;
+ char *pass2 = NULL;
int level = lp_passwordlevel();
NTSTATUS nt_status;
@@ -758,7 +758,10 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
}
/* make a copy of it */
- pstrcpy(pass2, password);
+ pass2 = talloc_strdup(talloc_tos(), password);
+ if (!pass2) {
+ return NT_STATUS_NO_MEMORY;
+ }
/* try all lowercase if it's currently all uppercase */
if (strhasupper(pass2)) {