From 7eff4931ac47d5a6acc3ccbd214ae6391776f52a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 28 Oct 2020 15:05:34 +0100 Subject: [PATCH] s4:torture: Pass buffer correctly to write() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../../source4/torture/basic/denytest.c: In function ‘torture_createx_specific.isra’: ../../source4/torture/basic/denytest.c:2372:9: error: ‘write’ reading 56 bytes from a region of size 8 [-Werror=stringop-overflow=] 2372 | res = write(data_file_fd, &cxd, cxd_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=14555 Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy Reviewed-by: Jeremy Allison (cherry picked from commit 5f92ec6988d2f4c20eab9449cbe17317588f6634) --- source4/torture/basic/denytest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 1c946b81b92..8e7a822df09 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -2369,7 +2369,7 @@ 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, cxd_len); + res = write(data_file_fd, cxd, cxd_len); if (res != cxd_len) { torture_result(tctx, TORTURE_FAIL, "(%s): write failed: %s!", -- 2.29.1