vfs_fruit: Fix CID 1433613 Operands don't affect result
authorVolker Lendecke <vl@samba.org>
Wed, 28 Mar 2018 12:17:59 +0000 (07:17 -0500)
committerJeremy Allison <jra@samba.org>
Wed, 28 Mar 2018 22:21:55 +0000 (00:21 +0200)
commitf3e98f41de25e3b52fd38f86317e428bfb53b287
tree6856af24ddd30b016e9d9369f3db716aba295a90
parentbb7da3357388f7cf950455ca4f42cd7d43c3f02b
vfs_fruit: Fix CID 1433613 Operands don't affect result

Two changes: First, we can't check multiplication overflow after the
operation. This has to be done before with a division. Second, there
is no OFF_T_MAX, and both operands are size_t, so check for
SIZE_MAX. The result is assigned to off_t, but I'm not sure where the
automatic coercion from size_t to off_t would happen.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c