1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

torture: Fix comparsion of uninitalized bytes.

As we compare string make sure we have the null terminator.

Found by valgrind.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 474eee0df7)
This commit is contained in:
Andreas Schneider 2013-07-02 15:24:40 +02:00 committed by Karolin Seeger
parent bef3fc8527
commit 67c8f87c77

View File

@ -70,6 +70,8 @@ static bool test_session_reauth1(struct torture_context *tctx,
torture_assert_ntstatus_ok_goto(tctx, status, ok, done, "setup2");
torture_assert_int_equal_goto(tctx, io.out.vuid, vuid1, ok, done, "setup2");
buf[dlen] = '\0';
num = smbcli_read(cli->tree, fnum, &buf, 0, dlen);
torture_assert_int_equal_goto(tctx, num, dlen, ok, done, "read file");
torture_assert_str_equal_goto(tctx, buf, data, ok, done, "read file");