diff options
author | Gary Lockyer <gary@catalyst.net.nz> | 2021-03-25 11:30:59 +1300 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-09-18 16:46:09 +0000 |
commit | 6b826a375a13f44a0486024ee09564cf3b1528ca (patch) | |
tree | c488858008056683b9916ce5233770e7e6824da7 | |
parent | a9aae34d5a97081dff9126328167678cfc4601c7 (diff) | |
download | samba-6b826a375a13f44a0486024ee09564cf3b1528ca.tar.gz |
CVE-2021-20251 auth4: Return only the result message and free the surrounding result
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit b954acfde258a1909ed60c1c3e1015701582719f)
-rw-r--r-- | selftest/knownfail.d/auth-sam | 1 | ||||
-rw-r--r-- | source4/auth/sam.c | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/selftest/knownfail.d/auth-sam b/selftest/knownfail.d/auth-sam index 048459e6555..438cea46415 100644 --- a/selftest/knownfail.d/auth-sam +++ b/selftest/knownfail.d/auth-sam @@ -1,4 +1,3 @@ -^samba.unittests.auth.sam.test_reread_account_not_locked.none ^samba.unittests.auth.sam.test_success_accounting_add_control_failed.none ^samba.unittests.auth.sam.test_success_accounting_build_mod_req_failed.none ^samba.unittests.auth.sam.test_success_accounting_commit_failed.none diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 2a63238d1b9..3190577818c 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -885,7 +885,8 @@ NTSTATUS authsam_reread_user_logon_data( TALLOC_FREE(res); return NT_STATUS_ACCOUNT_LOCKED_OUT; } - *current = res->msgs[0]; + *current = talloc_steal(mem_ctx, res->msgs[0]); + TALLOC_FREE(res); return NT_STATUS_OK; } |