summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-07-02 15:24:40 +0200
committerKarolin Seeger <kseeger@samba.org>2013-07-04 09:33:28 +0200
commit67c8f87c777d850cf9ec0080b4daa09adf40ec55 (patch)
tree7583490f058762ab81e150c1412201bac9430d25
parentbef3fc8527114adbaecaf6a7bbf17d49e598bf60 (diff)
downloadsamba-67c8f87c777d850cf9ec0080b4daa09adf40ec55.tar.gz
samba-67c8f87c777d850cf9ec0080b4daa09adf40ec55.tar.bz2
samba-67c8f87c777d850cf9ec0080b4daa09adf40ec55.zip
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 474eee0df7893a3a4546e1c6ea47220700c5b99f)
-rw-r--r--source4/torture/raw/session.c2
1 files changed, 2 insertions, 0 deletions
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");