From d64242f676dbeda52696e9138c01b6768b5a4eca Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 16 Jul 2024 16:59:12 +0200 Subject: [PATCH] s4:torture: Initialize union spoolss_KeyNames "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/rpc/spoolss.c:7835: var_decl: Declaring variable ""key_buffer"" without initializer. samba-4.20.0rc2/source4/torture/rpc/spoolss.c:7906: uninit_use: Using uninitialized value ""key_buffer.string_array"". 7904| 7905| if (array) { 7906|-> *array = key_buffer.string_array; 7907| } 7908|" Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- source4/torture/rpc/spoolss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 867b94ba654..54b4e8cfb7d 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -7832,7 +7832,7 @@ static bool test_EnumPrinterKey(struct torture_context *tctx, { struct spoolss_EnumPrinterKey r; uint32_t needed = 0; - union spoolss_KeyNames key_buffer; + union spoolss_KeyNames key_buffer = {}; int32_t offered[] = { 0, 1, 2, 3, 4, 5, -1, -2, -3, -4, -5, 256, 512, 1024, 2048 }; uint32_t _ndr_size; int i;