s4:torture:basic: fix 'Conditional jump or move ' valgrind error
authorNoel Power <noel.power@suse.com>
Mon, 18 Apr 2016 14:52:12 +0000 (15:52 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 25 Apr 2016 08:35:15 +0000 (10:35 +0200)
running smbtorture test base.bench-holdopen.bench-holdopen yields the
following valgrind trace.

==29953== Conditional jump or move depends on uninitialised value(s)
==29953==    at 0xF4634F0: _talloc_zero_array (in /usr/lib64/libtalloc.so.2.1.5)
==29953==    by 0x5AE257E: smbcli_request_setup_transport (rawrequest.c:101)
==29953==    by 0x5AE04AF: smb_raw_echo_send (clitransport.c:554)
==29953==    by 0x5AE0774: smb_raw_echo (clitransport.c:609)
==29953==    by 0x4183D3: torture_holdopen (misc.c:288)
==29953==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==29953==    by 0x955368F: internal_torture_run_test (torture.c:442)
==29953==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==29953==    by 0x2600A4: run_matching (smbtorture.c:110)
==29953==    by 0x25FF66: run_matching (smbtorture.c:95)
==29953==    by 0x2601C5: torture_run_named_tests (smbtorture.c:143)
==29953==    by 0x261E44: main (smbtorture.c:665)
==29953==
==29953== Conditional jump or move depends on uninitialised value(s)
==29953==    at 0xF4630E3: _talloc_zero (in /usr/lib64/libtalloc.so.2.1.5)
==29953==    by 0x5AE257E: smbcli_request_setup_transport (rawrequest.c:101)
==29953==    by 0x5AE04AF: smb_raw_echo_send (clitransport.c:554)
==29953==    by 0x5AE0774: smb_raw_echo (clitransport.c:609)
==29953==    by 0x4183D3: torture_holdopen (misc.c:288)
==29953==    by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856)
==29953==    by 0x955368F: internal_torture_run_test (torture.c:442)
==29953==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==29953==    by 0x2600A4: run_matching (smbtorture.c:110)
==29953==    by 0x25FF66: run_matching (smbtorture.c:95)
==29953==    by 0x2601C5: torture_run_named_tests (smbtorture.c:143)
==29953==    by 0x261E44: main (smbtorture.c:665)
==29953==

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/basic/misc.c

index 4e84e38c89d3c6c451dfe22d988e1968b17f7916..cbf1e9f45873ce234dc483d38ac9ecb2eb38c8fd 100644 (file)
@@ -284,7 +284,7 @@ bool torture_holdopen(struct torture_context *tctx,
 
        while (1) {
                struct smb_echo ec;
-
+               ZERO_STRUCT(ec);
                status = smb_raw_echo(cli->transport, &ec);
                torture_comment(tctx, ".");
                fflush(stdout);