From: Noel Power Date: Wed, 20 Apr 2016 08:53:50 +0000 (+0100) Subject: s4:torture:smb2: fix 'Use of uninitialised value of size 8' valgrind error. X-Git-Tag: talloc-2.1.7~156 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7e6d37e5e97c0c124f2c865118d28cc60ba6b92;p=thirdparty%2Fsamba.git s4:torture:smb2: fix 'Use of uninitialised value of size 8' valgrind error. smbtorture smb2.oplock.brl1.brl1 generates the following valgrind trace ==16002== Use of uninitialised value of size 8 ==16002== at 0x8F005DE: _samba_rijndaelEncrypt (rijndael-alg-fst.c:958) ==16002== by 0x8EFF24C: samba_AES_encrypt (aes.c:60) ==16002== by 0x8F01BB2: aes_cmac_128_final (aes_cmac_128.c:179) ==16002== by 0xB0D11E5: smb2_signing_sign_pdu (smb2_signing.c:78) ==16002== by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062) ==16002== by 0x5AFD5F5: smb2_transport_send (transport.c:237) ==16002== by 0x5B078DF: smb2_lock_send (lock.c:52) ==16002== by 0x5B07AAE: smb2_lock (lock.c:80) ==16002== by 0x4B50D8: test_smb2_oplock_brl1 (oplock.c:3352) ==16002== by 0x48B7B5: wrap_simple_2smb2_test (smb2.c:112) ==16002== by 0x955368F: internal_torture_run_test (torture.c:442) ==16002== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==16002== by 0x26013F: run_matching (smbtorture.c:110) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==16002== by 0x261EDF: main (smbtorture.c:665) ==16002== ==16002== Use of uninitialised value of size 8 ==16002== at 0x8F00649: _samba_rijndaelEncrypt (rijndael-alg-fst.c:963) ==16002== by 0x8EFF24C: samba_AES_encrypt (aes.c:60) ==16002== by 0x8F01BB2: aes_cmac_128_final (aes_cmac_128.c:179) ==16002== by 0xB0D11E5: smb2_signing_sign_pdu (smb2_signing.c:78) ==16002== by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062) ==16002== by 0x5AFD5F5: smb2_transport_send (transport.c:237) ==16002== by 0x5B078DF: smb2_lock_send (lock.c:52) ==16002== by 0x5B07AAE: smb2_lock (lock.c:80) ==16002== by 0x4B50D8: test_smb2_oplock_brl1 (oplock.c:3352) ==16002== by 0x48B7B5: wrap_simple_2smb2_test (smb2.c:112) ==16002== by 0x955368F: internal_torture_run_test (torture.c:442) ==16002== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==16002== by 0x26013F: run_matching (smbtorture.c:110) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==16002== by 0x261EDF: main (smbtorture.c:665) ==16002== ==16002== Use of uninitialised value of size 8 ==16002== at 0x8F006AF: _samba_rijndaelEncrypt (rijndael-alg-fst.c:968) ==16002== by 0x8EFF24C: samba_AES_encrypt (aes.c:60) ==16002== by 0x8F01BB2: aes_cmac_128_final (aes_cmac_128.c:179) ==16002== by 0xB0D11E5: smb2_signing_sign_pdu (smb2_signing.c:78) ==16002== by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062) ==16002== by 0x5AFD5F5: smb2_transport_send (transport.c:237) ==16002== by 0x5B078DF: smb2_lock_send (lock.c:52) ==16002== by 0x5B07AAE: smb2_lock (lock.c:80) ==16002== by 0x4B50D8: test_smb2_oplock_brl1 (oplock.c:3352) ==16002== by 0x48B7B5: wrap_simple_2smb2_test (smb2.c:112) ==16002== by 0x955368F: internal_torture_run_test (torture.c:442) ==16002== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==16002== by 0x26013F: run_matching (smbtorture.c:110) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260001: run_matching (smbtorture.c:95) ==16002== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==16002== by 0x261EDF: main (smbtorture.c:665) ==16002== Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c index 70717794a0d..165c4d7687d 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -3339,6 +3339,9 @@ static bool test_smb2_oplock_brl1(struct torture_context *tctx, ZERO_STRUCT(break_info); torture_comment(tctx, "a self BRL acquisition should break to none\n"); + + ZERO_STRUCT(lock); + lock[0].offset = 0; lock[0].length = 4; lock[0].flags = SMB2_LOCK_FLAG_EXCLUSIVE |