summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-09-23 00:10:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:05 -0500
commitccdf4e045f6275c58fbb9001119f2b4abf7845bf (patch)
treec4b64e8ad625aee9eb263cf0ae48ba3266519fca
parent3318a6e2c67670cd86c12cfcec4c2578087744dd (diff)
downloadsamba-ccdf4e045f6275c58fbb9001119f2b4abf7845bf.tar.gz
samba-ccdf4e045f6275c58fbb9001119f2b4abf7845bf.tar.bz2
samba-ccdf4e045f6275c58fbb9001119f2b4abf7845bf.zip
r2547: Another place to use convert_string_talloc().
Andrew Bartlett (This used to be commit 4904d814c0efd870ac42c790028a8448984e4749)
-rw-r--r--source4/torture/rpc/samr.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index e271f89ae0..5a9462a92a 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -355,7 +355,7 @@ static BOOL test_SetUserPass(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
encode_pw_buffer(u.info24.password.data, newpass, STR_UNICODE);
/* w2k3 ignores this length */
- u.info24.pw_len = str_charnum(newpass)*2;
+ u.info24.pw_len = strlen_m(newpass) * 2;
status = dcerpc_fetch_session_key(p, &session_key);
if (!NT_STATUS_IS_OK(status)) {
@@ -2424,12 +2424,10 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
/* Querydisplayinfo returns ascii -- convert */
- namelen = convert_string_allocate(CH_DISPLAY, CH_UNIX,
- q2.out.info.info5.entries[i].account_name.name,
- q2.out.info.info5.entries[i].account_name.name_len,
- (void **)&name);
- name = realloc(name, namelen+1);
- name[namelen] = 0;
+ namelen = convert_string_talloc(mem_ctx, CH_DISPLAY, CH_UNIX,
+ q2.out.info.info5.entries[i].account_name.name,
+ q2.out.info.info5.entries[i].account_name.name_len,
+ (void **)&name);
for (j=0; j<num_names; j++) {
if (names[j] == NULL)