Skip to content

Commit

Permalink
torture: allow us to correctly use sizeof(buf) in raw.open tests
Browse files Browse the repository at this point in the history
This changes the sizeof(buf) from sizeof(void *), 8 on 64-bit machines, to sizeof("test") (eg 5).

Found by AddressSanitizer

Andrew Bartlett

Change-Id: I01f18b35c041f3b16be9f6da8ae5d1917d7e24d9
Signed-off-by: Andrew Bartlett <[email protected]>
Reviewed-by: Kamen Mazdrashki <[email protected]>
  • Loading branch information
abartlet committed Sep 8, 2014
1 parent cb25480 commit e93affb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source4/torture/raw/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ static bool test_chained(struct torture_context *tctx, struct smbcli_state *cli)
NTSTATUS status;
int fnum = -1;
bool ret = true;
const char *buf = "test";
const char buf[] = "test";
char buf2[4];

torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
Expand Down Expand Up @@ -1420,7 +1420,7 @@ static bool test_no_leading_slash(struct torture_context *tctx, struct smbcli_st
NTSTATUS status;
int fnum = -1;
bool ret = true;
const char *buf = "test";
const char buf[] = "test";

torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);

Expand Down Expand Up @@ -1697,7 +1697,7 @@ static bool test_chained_ntcreatex_readx(struct torture_context *tctx, struct sm
NTSTATUS status;
int fnum = -1;
bool ret = true;
const char *buf = "test";
const char buf[] = "test";
char buf2[4];

torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
Expand Down

0 comments on commit e93affb

Please sign in to comment.