summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-10 17:06:39 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 15:00:02 +0100
commitef0a945bf8e6310acb41f90a2179e61d412a61ea (patch)
tree030066a1217802d6fb60f5e4ab80a6dcdb720e94 /source4
parentb4884dcff7362d585d93c3acf08e8c4835d918d0 (diff)
downloadsamba-ef0a945bf8e6310acb41f90a2179e61d412a61ea.tar.gz
samba-ef0a945bf8e6310acb41f90a2179e61d412a61ea.tar.bz2
samba-ef0a945bf8e6310acb41f90a2179e61d412a61ea.zip
torture: Make sure we use the correct size for cxd.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/basic/denytest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 69717be3ba..feeea32eb1 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));