summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-21 22:55:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:19:12 -0500
commitead672ea099cff71b3d5ab7bbb7c52a4f2fb1a6c (patch)
tree93e499b392b8f43a50b50fa1a816c83bcd2d880f /source4/torture
parent952ac3cba5a511ddbad82b826c1aa4b201a46891 (diff)
downloadsamba-ead672ea099cff71b3d5ab7bbb7c52a4f2fb1a6c.tar.gz
samba-ead672ea099cff71b3d5ab7bbb7c52a4f2fb1a6c.tar.bz2
samba-ead672ea099cff71b3d5ab7bbb7c52a4f2fb1a6c.zip
r18800: fix a write behind the buffer bug...
Thanks Herb for finding this:-) This was my bug, I typed it in on gd's laptop and he just run 'svn ci' metze (This used to be commit 3c08e29f4fdde586084bdcf1b36eaf92ae944750)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/samr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index f9bd25dc37..b387ec70bf 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1887,10 +1887,8 @@ static BOOL test_ChangePassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
char *v = generate_random_str(mem_ctx, 1);
int i;
- for (i=0; i <ARRAY_SIZE(simple_pass); i++) {
- simple_pass[i] = *v;
- }
- simple_pass[i] = '\0';
+ ZERO_STRUCT(simple_pass);
+ memset(simple_pass, *v, sizeof(simple_pass) - 1);
/* test what happens when picking a simple password */
if (!test_ChangePasswordUser3(p, mem_ctx, acct_name, 0, password, simple_pass, 0, True)) {