From 474eee0df7893a3a4546e1c6ea47220700c5b99f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 2 Jul 2013 15:24:40 +0200 Subject: 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 Reviewed-by: Volker Lendecke --- source4/torture/raw/session.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source4/torture/raw/session.c b/source4/torture/raw/session.c index 5b5b782a1c..fbfdced2f8 100644 --- a/source4/torture/raw/session.c +++ b/source4/torture/raw/session.c @@ -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"); -- cgit