From ef0a945bf8e6310acb41f90a2179e61d412a61ea Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 10 Dec 2012 17:06:39 +0100 Subject: [PATCH] torture: Make sure we use the correct size for cxd. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source4/torture/basic/denytest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 69717be3ba8..feeea32eb10 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -2367,9 +2367,10 @@ static bool torture_createx_specific(struct torture_context *tctx, struct } if (data_file_fd >= 0) { + size_t cxd_len = sizeof(struct createx_data); found = true; - res = write(data_file_fd, &cxd, sizeof(cxd)); - if (res != sizeof(cxd)) { + res = write(data_file_fd, &cxd, cxd_len); + if (res != cxd_len) { torture_result(tctx, TORTURE_FAIL, "(%s): write failed: %s!", __location__, strerror(errno)); -- 2.11.4.GIT