diff options
author | Michael Adam <obnox@samba.org> | 2009-12-30 15:37:23 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-01-07 11:07:56 +0100 |
commit | 0172587d8d56e1163c27014e1e092580d0158e10 (patch) | |
tree | 312f8710a45f861d2f950a5699209250fea95529 /source3/auth | |
parent | 7ac18c743b50b8cd63284326bd648675db63c557 (diff) | |
download | samba-0172587d8d56e1163c27014e1e092580d0158e10.tar.gz samba-0172587d8d56e1163c27014e1e092580d0158e10.tar.bz2 samba-0172587d8d56e1163c27014e1e092580d0158e10.zip |
s3:auth:sam_password_ok: fix allocation of a data blob.
data_blob(mem_ctx, 16) does not use mem_ctx as a talloc ctx but
copies 16 bytes from mem_ctx into the newly allocated data blob.
This can not have been intentional. A blank uint8_t array of
length 16 is allocated by passing NULL instead of mem_ctx.
And using data_blob_talloc(mem_ctx, NULL, 16) adds the allocated
blank 16 byte array to mem_ctx - so this is what must have been
intended.
Michael
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_sam.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 381ad5b83c..42ede64141 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -82,7 +82,7 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, } if (client_lm_hash || client_nt_hash) { - *user_sess_key = data_blob(mem_ctx, 16); + *user_sess_key = data_blob_talloc(mem_ctx, NULL, 16); if (!user_sess_key->data) { return NT_STATUS_NO_MEMORY; } |