From c323629a1a3c3baf4ce799d2a9efe446822f6ec0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 16 Mar 2010 16:05:07 +0100 Subject: s4-smbtorture: use random buffer for extended SetValue test in RPC-WINREG. Guenther --- source4/torture/rpc/winreg.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index ca4434bc98..a5a3812b48 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2073,11 +2073,16 @@ static bool test_SetValue_extended(struct dcerpc_binding_handle *b, uint32_t w_size, w_length; uint8_t *w_data; - const char *string = generate_random_str(tctx, l); - DATA_BLOB blob = data_blob_string_const(string); + uint32_t size; + uint8_t *data; + + size = l; + data = talloc_array(tctx, uint8_t, size); + + generate_random_buffer(data, size); torture_assert(tctx, - test_SetValue(b, tctx, handle, value_name, types[t], blob.data, blob.length), + test_SetValue(b, tctx, handle, value_name, types[t], data, size), "test_SetValue failed"); torture_assert(tctx, @@ -2089,9 +2094,9 @@ static bool test_SetValue_extended(struct dcerpc_binding_handle *b, "test_DeleteValue failed"); torture_assert_int_equal(tctx, w_type, types[t], "winreg type mismatch"); - torture_assert_int_equal(tctx, w_size, blob.length, "winreg size mismatch"); - torture_assert_int_equal(tctx, w_length, blob.length, "winreg length mismatch"); - torture_assert_mem_equal(tctx, w_data, blob.data, blob.length, "winreg buffer mismatch"); + torture_assert_int_equal(tctx, w_size, size, "winreg size mismatch"); + torture_assert_int_equal(tctx, w_length, size, "winreg length mismatch"); + torture_assert_mem_equal(tctx, w_data, data, size, "winreg buffer mismatch"); } } -- cgit