From aedfee8f49b643ae7d1ee4f0bc53f2a835652f30 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 30 Jul 2019 07:10:28 +0200 Subject: [PATCH] smbd: Fix a signed/unsigned warning For whatever reason, "st_size" in "struct stat" is an off_t, which is a signed integer. Negative sizes don't really make sense, so this cast should be safe. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index ee6de028a26..c81696d3831 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5304,7 +5304,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, /* Save the requested allocation size. */ if ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN)) { - if ((allocation_size > fsp->fsp_name->st.st_ex_size) + if ((allocation_size > (uint64_t)fsp->fsp_name->st.st_ex_size) && !(fsp->is_directory)) { fsp->initial_allocation_size = smb_roundup( -- 2.47.3