]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Initialize union spoolss_KeyNames
authorAndreas Schneider <asn@samba.org>
Tue, 16 Jul 2024 14:59:12 +0000 (16:59 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 18 Jul 2024 12:47:30 +0000 (12:47 +0000)
"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 <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/torture/rpc/spoolss.c

index 867b94ba65418ec5997bf26412f0dfca46afeb76..54b4e8cfb7d84e80eb1ca0cb98a18ccd350988d7 100644 (file)
@@ -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;