From: Noel Power Date: Mon, 18 Apr 2016 19:28:32 +0000 (+0100) Subject: s4:torture:smb2 fix 'Use of uninitialised value of size 8' valgrind error. X-Git-Tag: talloc-2.1.7~157 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfc2349a566d2edb02d2a37bc9c81f1c4019af64;p=thirdparty%2Fsamba.git s4:torture:smb2 fix 'Use of uninitialised value of size 8' valgrind error. smbtorture test smb2.oplock.batch10.batch10 produces the following valgrind trace Use of uninitialised value of size 8 ==9662== at 0x8F005A1: _samba_rijndaelEncrypt (rijndael-alg-fst.c:956) ==9662== by 0x8EFF24C: samba_AES_encrypt (aes.c:60) ==9662== by 0x8F01A74: aes_cmac_128_update (aes_cmac_128.c:151) ==9662== by 0xB0D11B7: smb2_signing_sign_pdu (smb2_signing.c:74) ==9662== by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062) ==9662== by 0x5AFD5F5: smb2_transport_send (transport.c:237) ==9662== by 0x5B04C89: smb2_write_send (write.c:49) ==9662== by 0x5B04F85: smb2_write (write.c:79) ==9662== by 0x4AD523: test_smb2_oplock_batch10 (oplock.c:1820) ==9662== by 0x48B7B5: wrap_simple_2smb2_test (smb2.c:112) ==9662== by 0x955368F: internal_torture_run_test (torture.c:442) ==9662== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==9662== by 0x26013F: run_matching (smbtorture.c:110) ==9662== by 0x260001: run_matching (smbtorture.c:95) ==9662== by 0x260001: run_matching (smbtorture.c:95) ==9662== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==9662== by 0x261EDF: main (smbtorture.c:665) ==9662== ==9662== Use of uninitialised value of size 8 ==9662== at 0x8F005C2: _samba_rijndaelEncrypt (rijndael-alg-fst.c:957) ==9662== by 0x8EFF24C: samba_AES_encrypt (aes.c:60) ==9662== by 0x8F01A74: aes_cmac_128_update (aes_cmac_128.c:151) ==9662== by 0xB0D11B7: smb2_signing_sign_pdu (smb2_signing.c:74) ==9662== by 0xB0D984A: smb2cli_req_compound_submit (smbXcli_base.c:3062) ==9662== by 0x5AFD5F5: smb2_transport_send (transport.c:237) ==9662== by 0x5B04C89: smb2_write_send (write.c:49) ==9662== by 0x5B04F85: smb2_write (write.c:79) ==9662== by 0x4AD523: test_smb2_oplock_batch10 (oplock.c:1820) ==9662== by 0x48B7B5: wrap_simple_2smb2_test (smb2.c:112) ==9662== by 0x955368F: internal_torture_run_test (torture.c:442) ==9662== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==9662== by 0x26013F: run_matching (smbtorture.c:110) ==9662== by 0x260001: run_matching (smbtorture.c:95) ==9662== by 0x260001: run_matching (smbtorture.c:95) ==9662== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==9662== by 0x261EDF: main (smbtorture.c:665) ==9662== Please enter the commit message for your changes. Lines starting 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 fdd29c3c905..70717794a0d 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -1811,7 +1811,7 @@ static bool test_smb2_oplock_batch10(struct torture_context *tctx, { struct smb2_write wr; DATA_BLOB data; - data = data_blob_talloc(tree1, NULL, UINT16_MAX); + data = data_blob_talloc_zero(tree1, UINT16_MAX); data.data[0] = (const uint8_t)'x'; ZERO_STRUCT(wr); wr.in.file.handle = h1;