[PATCH] s4-libcli: Fix comparsion of uninitalized bytes.

Andreas Schneider asn at samba.org
Tue Jul 2 07:04:45 MDT 2013


On Tuesday 02 July 2013 14:36:12 Volker Lendecke wrote:
> To be honest, I don't understand why this should be
> necessary. I thought the idea of the smbcli_read call would
> be to download something from the server and fill it into
> "_buf". This would make the memory initialized. Why does
> valgrind require to first initialize something that we
> overwrite later anyway?
> 
> Don't get me wrong. I am not against fixing a valgrind bug.
> I just want to understand this.

Ah sorry, it complains about the torture_assert

torture_assert_str_equal_goto(tctx, buf, data, ok, done, "read file");

==6125== Conditional jump or move depends on uninitialised value(s)
==6125==    at 0x4C2D8D0: strcmp (in /usr/lib64/valgrind/vgpreload_memcheck-
amd64-linux.so)
==6125==    by 0x51D71E7: strcmp_safe (util.c:926)
==6125==    by 0x1D36BA: test_session_reauth1 (session.c:75)
==6125==    by 0x164399: wrap_simple_1smb_test (util_smb.c:819)
==6125==    by 0x520B549: internal_torture_run_test (torture.c:442)
==6125==    by 0x520B79D: torture_run_tcase_restricted (torture.c:506)
==6125==    by 0x520B152: torture_run_suite_restricted (torture.c:357)
==6125==    by 0x520B0B1: torture_run_suite (torture.c:339)
==6125==    by 0x24F88E: run_matching (smbtorture.c:93)
==6125==    by 0x24F8C5: run_matching (smbtorture.c:95)
==6125==    by 0x24FB24: torture_run_named_tests (smbtorture.c:143)
==6125==    by 0x251736: main (smbtorture.c:654)


So the first patch is the correct one.


-- 
Andreas Schneider                   GPG-ID: F33E3FC6
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list