1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s4:torture: Pass buffer correctly to write()

../../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 <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 28 17:52:19 UTC 2020 on sn-devel-184
This commit is contained in:
Andreas Schneider 2020-10-28 15:05:34 +01:00 committed by Jeremy Allison
parent d619a57804
commit 5f92ec6988

View File

@ -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!",