From: Volker Lendecke Date: Tue, 30 Jul 2019 05:10:28 +0000 (+0200) Subject: smbd: Fix a signed/unsigned warning X-Git-Tag: tdb-1.4.2~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aedfee8f49b643ae7d1ee4f0bc53f2a835652f30;p=thirdparty%2Fsamba.git 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 --- 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(