s4:torture:libnet: fix 'Conditional jump or move' valgrind error
authorNoel Power <noel.power@suse.com>
Wed, 20 Apr 2016 10:46:24 +0000 (11:46 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 25 Apr 2016 08:35:16 +0000 (10:35 +0200)
smbtorture test net.domopen.domopen generated the following valgrind
trace.

==29054== Conditional jump or move depends on uninitialised value(s)
==29054==    at 0x9788D31: libnet_DomainOpen_send (libnet_domain.c:617)
==29054==    by 0x9788E01: libnet_DomainOpen (libnet_domain.c:676)
==29054==    by 0x595F5D: test_domainopen (domain.c:41)
==29054==    by 0x5961AD: torture_domainopen (domain.c:101)
==29054==    by 0x9553F62: wrap_simple_test (torture.c:632)
==29054==    by 0x955368F: internal_torture_run_test (torture.c:442)
==29054==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==29054==    by 0x26013F: run_matching (smbtorture.c:110)
==29054==    by 0x260001: run_matching (smbtorture.c:95)
==29054==    by 0x260260: torture_run_named_tests (smbtorture.c:143)
==29054==    by 0x261EDF: main (smbtorture.c:665)
==29054==
==29054== Conditional jump or move depends on uninitialised value(s)
==29054==    at 0x9788D95: libnet_DomainOpen_recv (libnet_domain.c:648)
==29054==    by 0x9788E1D: libnet_DomainOpen (libnet_domain.c:677)
==29054==    by 0x595F5D: test_domainopen (domain.c:41)
==29054==    by 0x5961AD: torture_domainopen (domain.c:101)
==29054==    by 0x9553F62: wrap_simple_test (torture.c:632)
==29054==    by 0x955368F: internal_torture_run_test (torture.c:442)
==29054==    by 0x9553A6B: torture_run_test_restricted (torture.c:542)
==29054==    by 0x26013F: run_matching (smbtorture.c:110)
==29054==    by 0x260001: run_matching (smbtorture.c:95)
==29054==    by 0x260260: torture_run_named_tests (smbtorture.c:143)

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/libnet/domain.c

index 71753de826dc8648a71b044cba9a497757f3f73d..c1cfc919d002215b45124411a25a7cdc01834e51 100644 (file)
@@ -33,6 +33,8 @@ static bool test_domainopen(struct torture_context *tctx,
        NTSTATUS status;
        struct libnet_DomainOpen io;
 
+       ZERO_STRUCT(io);
+
        torture_comment(tctx, "opening domain\n");
 
        io.in.domain_name  = talloc_strdup(mem_ctx, domname->string);