s4:torture:smb2: fix 'Use of uninitialised value of size 8' valgrind error.
authorNoel Power <noel.power@suse.com>
Wed, 20 Apr 2016 10:26:03 +0000 (11:26 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 25 Apr 2016 08:35:16 +0000 (10:35 +0200)
smbtorture test smb2.streams.attributes.attributes generates the following
valgrind trace,

==17997== Use of uninitialised value of size 8
==17997==    at 0x8F005C2: _samba_rijndaelEncrypt (rijndael-alg-fst.c:957)
==17997==    by 0x8EFF24C: samba_AES_encrypt (aes.c:60)
==17997==    by 0x8F01A74: aes_cmac_128_update (aes_cmac_128.c:151)
==17997==    by 0xB0D11B7: smb2_signing_sign_pdu (smb2_signing.c:74)
==17997==    by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062)
==17997==    by 0x5AFD5F5: smb2_transport_send (transport.c:237)
==17997==    by 0x5B030F3: smb2_close_send (close.c:42)
==17997==    by 0x5B0358A: smb2_close (close.c:78)
==17997==    by 0x5B087B3: smb2_util_close (util.c:40)
==17997==    by 0x521457: test_stream_attributes (streams.c:1750)
==17997==    by 0x48B452: wrap_simple_1smb2_test (smb2.c:52)
==17997==    by 0x955368F: internal_torture_run_test (torture.c:442)
==17997==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==17997==    by 0x26013F: run_matching (smbtorture.c:110)
==17997==    by 0x260001: run_matching (smbtorture.c:95)
==17997==    by 0x260001: run_matching (smbtorture.c:95)
==17997==    by 0x260260: torture_run_named_tests (smbtorture.c:143)
==17997==    by 0x261EDF: main (smbtorture.c:665)
==17997==
==17997== Use of uninitialised value of size 8
==17997==    at 0x8F005DE: _samba_rijndaelEncrypt (rijndael-alg-fst.c:958)
==17997==    by 0x8EFF24C: samba_AES_encrypt (aes.c:60)
==17997==    by 0x8F01A74: aes_cmac_128_update (aes_cmac_128.c:151)
==17997==    by 0xB0D11B7: smb2_signing_sign_pdu (smb2_signing.c:74)
==17997==    by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062)
==17997==    by 0x5AFD5F5: smb2_transport_send (transport.c:237)
==17997==    by 0x5B030F3: smb2_close_send (close.c:42)
==17997==    by 0x5B0358A: smb2_close (close.c:78)
==17997==    by 0x5B087B3: smb2_util_close (util.c:40)
==17997==    by 0x521457: test_stream_attributes (streams.c:1750)
==17997==    by 0x48B452: wrap_simple_1smb2_test (smb2.c:52)
==17997==    by 0x955368F: internal_torture_run_test (torture.c:442)
==17997==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==17997==    by 0x26013F: run_matching (smbtorture.c:110)
==17997==    by 0x260001: run_matching (smbtorture.c:95)
==17997==    by 0x260001: run_matching (smbtorture.c:95)
==17997==    by 0x260260: torture_run_named_tests (smbtorture.c:143)
==17997==    by 0x261EDF: main (smbtorture.c:665)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/smb2/streams.c

index 8aa4b1a393405c036a19e260a83459cd1523583d..8c3f16152759522ed21ca20d22e0f99ce90a980b 100644 (file)
@@ -1685,6 +1685,9 @@ static bool test_stream_attributes(struct torture_context *tctx,
        union smb_setfileinfo sfinfo;
        time_t basetime = (time(NULL) - 86400) & ~1;
 
+       ZERO_STRUCT(h);
+       ZERO_STRUCT(h1);
+
        torture_comment(tctx, "(%s) testing attribute setting on stream\n",
                        __location__);