From: Andreas Schneider Date: Tue, 16 Jul 2024 14:59:12 +0000 (+0200) Subject: s4:torture: Initialize union spoolss_KeyNames X-Git-Tag: tdb-1.4.11~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d64242f676dbeda52696e9138c01b6768b5a4eca;p=thirdparty%2Fsamba.git 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 --- 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;