diff options
| author | Andrew Bartlett <abartlet@samba.org> | 2014-09-02 14:28:04 +1200 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2014-09-08 07:26:34 +0200 |
| commit | e93affbe1b4ff32858988bde79d00cdc82729089 (patch) | |
| tree | c557380158fc6fbbb07dfc04b2a4e8bb9e2c8491 | |
| parent | cb25480e82cb2e0ef8793fd9c21d710208c822f3 (diff) | |
| download | samba-e93affbe1b4ff32858988bde79d00cdc82729089.tar.gz samba-e93affbe1b4ff32858988bde79d00cdc82729089.tar.xz samba-e93affbe1b4ff32858988bde79d00cdc82729089.zip | |
torture: allow us to correctly use sizeof(buf) in raw.open tests
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 <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
| -rw-r--r-- | source4/torture/raw/open.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 763c718a98..679a7c24f7 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -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); @@ -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); @@ -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); |
