[PATCH] fruit: disable useless size_t overflow check
authorMichael Tokarev <mjt@tls.msk.ru>
Thu, 17 Nov 2022 20:51:03 +0000 (23:51 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 16 Oct 2023 15:26:31 +0000 (16:26 +0100)
commit3d932e31949d123fa7eb10833b1050bb44402c84
tree555c28d33f479ecfcda11d33b7001be16ea4bb0e
parent546f4b04f1c4dd92239911d58c4aa288f3d70d3d
[PATCH] fruit: disable useless size_t overflow check

From e4bf63c976b0e3253f980360b2fe6244092b777c Mon Sep 17 00:00:00 2001
Bug-Debian: http://bugs.debian.org/974868

As has been said several times in
https://bugzilla.samba.org/show_bug.cgi?id=13622 ,
the check 'bandsize > SIZE_MAX/nbands' is useless.  But it
is also wrong, in 2 ways: first, nbands might be 0 (when
no bands has been allocated yet), and second, there's no
point in comparing this with SIZE_MAX, since size_t on 32bit
platforms is a 32bit integer, while bandsize is off_t which
is 64bits (samba always enables LFS).

This check causes the module to fail when bandsize*nbands
exceeds 32bits, which has been reported for example at
https://bugs.debian.org/974868 .

Whole thing can't overflow because it is already guarded
by time_machine_max_size.  Or at the very least, by current
disk sizes... :)

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gbp-Pq: Name fruit-disable-useless-size_t-overflow-check.patch
source3/modules/vfs_fruit.c