summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-19 16:02:01 +0100
committerAlexander Bokovoy <ab@samba.org>2013-02-22 16:36:13 +0100
commit1d24fa6919a4ff7588c20f1a0365fbfcfd404203 (patch)
treecc6a9a274cb71a1eb7f3dd070d4522bf8df09eef /source4/torture
parentaff301d9ebc4f5c1be059838a8a6ef6b38129f88 (diff)
downloadsamba-1d24fa6919a4ff7588c20f1a0365fbfcfd404203.tar.gz
samba-1d24fa6919a4ff7588c20f1a0365fbfcfd404203.tar.bz2
samba-1d24fa6919a4ff7588c20f1a0365fbfcfd404203.zip
torture: Fix memcmp of short buffer.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 145651b41d..0968cfec5b 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -1395,7 +1395,7 @@ static bool test_chained(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.openxreadx.out.file.fnum;
- if (memcmp(buf, buf2, sizeof(buf)) != 0) {
+ if (memcmp(buf, buf2, MIN(sizeof(buf), sizeof(buf2))) != 0) {
torture_result(tctx, TORTURE_FAIL,
"wrong data in reply buffer\n");
ret = false;
@@ -1746,7 +1746,7 @@ static bool test_chained_ntcreatex_readx(struct torture_context *tctx, struct sm
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatexreadx.out.file.fnum;
- if (memcmp(buf, buf2, sizeof(buf)) != 0) {
+ if (memcmp(buf, buf2, MIN(sizeof(buf), sizeof(buf2))) != 0) {
torture_result(tctx, TORTURE_FAIL,
"(%s): wrong data in reply buffer\n", __location__);
ret = false;