summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/spoolss.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-10 00:16:46 +0100
committerGünther Deschner <gd@samba.org>2010-03-10 00:46:23 +0100
commit62b41e684286ec04dfb0c03b42d0d028212084c9 (patch)
treed0def8061172b09a8b91e396145aee1edef6122d /source4/torture/rpc/spoolss.c
parent6d10645bcae39f1377c1e3bfd01578519586289d (diff)
downloadsamba-62b41e684286ec04dfb0c03b42d0d028212084c9.tar.gz
samba-62b41e684286ec04dfb0c03b42d0d028212084c9.tar.bz2
samba-62b41e684286ec04dfb0c03b42d0d028212084c9.zip
s4-smbtorture: rework test_winreg_QueryValue in RPC-SPOOLSS-PRINTER once again.
Guenther
Diffstat (limited to 'source4/torture/rpc/spoolss.c')
-rw-r--r--source4/torture/rpc/spoolss.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index f83d3b5906..84e73c337f 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -3345,17 +3345,20 @@ static bool test_winreg_QueryValue(struct torture_context *tctx,
uint32_t data_size = 0;
uint32_t data_length = 0;
struct winreg_String valuename;
+ uint8_t *data = NULL;
init_winreg_String(&valuename, value_name);
+ data = talloc_zero_array(tctx, uint8_t, 0);
+
r.in.handle = handle;
r.in.value_name = &valuename;
r.in.type = &type;
r.in.data_size = &data_size;
r.in.data_length = &data_length;
- r.in.data = talloc_zero_array(tctx, uint8_t, *r.in.data_size);
+ r.in.data = data;
r.out.type = &type;
- r.out.data = talloc_zero_array(tctx, uint8_t, *r.in.data_size);
+ r.out.data = data;
r.out.data_size = &data_size;
r.out.data_length = &data_length;
@@ -3364,7 +3367,9 @@ static bool test_winreg_QueryValue(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryValue(p, tctx, &r), "QueryValue failed");
if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
*r.in.data_size = *r.out.data_size;
- r.out.data = talloc_zero_array(tctx, uint8_t, *r.in.data_size);
+ data = talloc_zero_array(tctx, uint8_t, *r.in.data_size);
+ r.in.data = data;
+ r.out.data = data;
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryValue(p, tctx, &r), "QueryValue failed");
}
torture_assert_werr_ok(tctx, r.out.result, "QueryValue failed");