diff options
author | Jeremy Allison <jra@samba.org> | 2011-03-29 11:16:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-03-29 21:01:49 +0200 |
commit | 0c5214e2eb6249914230f092fe35dfa49da24c34 (patch) | |
tree | a7e0b1952b1993e1859a6653fc38caf2501e6858 /source4/rpc_server/samr | |
parent | 1e50f9a5c263ed19ef8e9c689c96f1e51194f405 (diff) | |
download | samba-0c5214e2eb6249914230f092fe35dfa49da24c34.tar.gz samba-0c5214e2eb6249914230f092fe35dfa49da24c34.tar.bz2 samba-0c5214e2eb6249914230f092fe35dfa49da24c34.zip |
Ensure convert_string_XXX is always called with a valid converted_size pointer.
Preparation for cleaning up this API.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/rpc_server/samr')
-rw-r--r-- | source4/rpc_server/samr/samr_password.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c index 873c0d8561..8963b0436e 100644 --- a/source4/rpc_server/samr/samr_password.c +++ b/source4/rpc_server/samr/samr_password.c @@ -181,6 +181,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, uint8_t new_lm_hash[16]; struct samr_Password lm_verifier; size_t unicode_pw_len; + size_t converted_size = 0; if (pwbuf == NULL) { return NT_STATUS_INVALID_PARAMETER; @@ -238,7 +239,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, CH_DOS, CH_UNIX, (const char *)new_password.data, new_password.length, - (void **)&new_pass, NULL)) { + (void **)&new_pass, &converted_size)) { DEBUG(3,("samr: failed to convert incoming password buffer to unix charset\n")); return NT_STATUS_WRONG_PASSWORD; } @@ -397,11 +398,13 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, * this) */ if (lm_pwd && r->in.lm_verifier != NULL) { char *new_pass; + size_t converted_size = 0; + if (!convert_string_talloc_handle(mem_ctx, lpcfg_iconv_handle(dce_call->conn->dce_ctx->lp_ctx), CH_UTF16, CH_UNIX, (const char *)new_password.data, new_password.length, - (void **)&new_pass, NULL)) { + (void **)&new_pass, &converted_size)) { E_deshash(new_pass, new_lm_hash); E_old_pw_hash(new_nt_hash, lm_pwd->hash, lm_verifier.hash); if (memcmp(lm_verifier.hash, r->in.lm_verifier->hash, 16) != 0) { |