summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-07 04:39:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:30 -0500
commit11ce2cfd70df264c5c91b4daaa9a01c5abc673b0 (patch)
treef00bf95389509ca8655f3b1cf1dfec76289790b3 /source4/torture
parent066134f2414e8688fd980b619f9e597538c8766d (diff)
downloadsamba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.tar.gz
samba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.tar.bz2
samba-11ce2cfd70df264c5c91b4daaa9a01c5abc673b0.zip
r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions - fixes the code that broke from the above while doing this I fixed quite a number of places that were incorrectly using the non type-safe talloc functions to use the type safe ones. Some were even doing multiplies for array allocation, which is potentially unsafe. (This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/gentest.c2
-rw-r--r--source4/torture/local/idtree.c4
-rw-r--r--source4/torture/rap/rap.c3
-rw-r--r--source4/torture/raw/read.c8
-rw-r--r--source4/torture/raw/search.c6
-rw-r--r--source4/torture/raw/write.c8
-rw-r--r--source4/torture/rpc/samsync.c2
-rw-r--r--source4/torture/rpc/winreg.c2
8 files changed, 18 insertions, 17 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 5d8c7bf8fd..81e2a59f34 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -1358,7 +1358,7 @@ static BOOL handler_writex(int instance)
parm[0].writex.in.wmode = gen_bits_mask(0xFFFF);
parm[0].writex.in.remaining = gen_io_count();
parm[0].writex.in.count = gen_io_count();
- parm[0].writex.in.data = talloc_zero(current_op.mem_ctx, parm[0].writex.in.count);
+ parm[0].writex.in.data = talloc_zero_size(current_op.mem_ctx, parm[0].writex.in.count);
GEN_COPY_PARM;
GEN_SET_FNUM(writex.in.fnum);
diff --git a/source4/torture/local/idtree.c b/source4/torture/local/idtree.c
index 3f30d7123f..94463cefa6 100644
--- a/source4/torture/local/idtree.c
+++ b/source4/torture/local/idtree.c
@@ -35,8 +35,8 @@ BOOL torture_local_idtree(void)
idr = idr_init(ctx);
- ids = talloc_zero_array_p(ctx, int, n);
- present = talloc_zero_array_p(ctx, int, n);
+ ids = talloc_zero_array(ctx, int, n);
+ present = talloc_zero_array(ctx, int, n);
for (i=0;i<n;i++) {
ids[i] = -1;
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index b47cfa2997..0080a80951 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -82,6 +82,7 @@ static void rap_cli_push_paramdesc(struct rap_call *call, char desc)
call->paramdesc = talloc_realloc(call->mem_ctx,
call->paramdesc,
+ uint8_t,
len+2);
call->paramdesc[len] = desc;
call->paramdesc[len+1] = '\0';
@@ -151,7 +152,7 @@ static NTSTATUS rap_pull_string(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr,
if ( string_offset + len + 1 > ndr->data_size )
return NT_STATUS_INVALID_PARAMETER;
- *dest = talloc_zero(mem_ctx, len+1);
+ *dest = talloc_zero_size(mem_ctx, len+1);
pull_ascii(*dest, p, len+1, len, 0);
return NT_STATUS_OK;
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 12818f7ba6..fb2e2ddec2 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -90,7 +90,7 @@ static BOOL test_read(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -214,7 +214,7 @@ static BOOL test_lockread(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -357,7 +357,7 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -551,7 +551,7 @@ static BOOL test_readbraw(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *test_data = "TEST DATA";
uint_t seed = time(NULL);
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 55acaba2b2..84466d0cde 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -960,9 +960,9 @@ static BOOL test_many_dirs(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_close(cli->tree, fnum);
}
- file = talloc_zero_array_p(mem_ctx, union smb_search_data, num_dirs);
- file2 = talloc_zero_array_p(mem_ctx, union smb_search_data, num_dirs);
- file3 = talloc_zero_array_p(mem_ctx, union smb_search_data, num_dirs);
+ file = talloc_zero_array(mem_ctx, union smb_search_data, num_dirs);
+ file2 = talloc_zero_array(mem_ctx, union smb_search_data, num_dirs);
+ file3 = talloc_zero_array(mem_ctx, union smb_search_data, num_dirs);
printf("Search first on %d dirs\n", num_dirs);
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index 06fbe667ea..698520258d 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -104,7 +104,7 @@ static BOOL test_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -221,7 +221,7 @@ static BOOL test_writex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -397,7 +397,7 @@ static BOOL test_writeunlock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
@@ -534,7 +534,7 @@ static BOOL test_writeclose(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
uint_t seed = time(NULL);
union smb_fileinfo finfo;
- buf = talloc_zero(mem_ctx, maxsize);
+ buf = talloc_zero_size(mem_ctx, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
return False;
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 86e10678c9..4c47870015 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -878,7 +878,7 @@ static BOOL samsync_handle_account(TALLOC_CTX *mem_ctx, struct samsync_state *sa
TEST_SEC_DESC_EQUAL(account->sdbuf, lsa, &acct_handle);
- found_priv_in_lsa = talloc_zero_array_p(mem_ctx, BOOL, account->privilege_entries);
+ found_priv_in_lsa = talloc_zero_array(mem_ctx, BOOL, account->privilege_entries);
e.in.handle = &acct_handle;
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 14c18df370..9e24a9f055 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -367,7 +367,7 @@ static BOOL test_QueryMultipleValues(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.num_values = 1;
r.in.buffer_size = r.out.buffer_size = talloc_p(mem_ctx, uint32);
*r.in.buffer_size = 0x20;
- r.in.buffer = r.out.buffer = talloc_zero_array_p(mem_ctx, uint8, *r.in.buffer_size);
+ r.in.buffer = r.out.buffer = talloc_zero_array(mem_ctx, uint8, *r.in.buffer_size);
status = dcerpc_winreg_QueryMultipleValues(p, mem_ctx, &r);
if(NT_STATUS_IS_ERR(status)) {