]> git.ipfire.org Git - thirdparty/samba.git/commit
fruit: fixup size_t overflow check
authorMichael Tokarev <mjt@tls.msk.ru>
Thu, 17 Nov 2022 20:51:03 +0000 (23:51 +0300)
committerPavel Filipensky <pfilipensky@samba.org>
Sat, 4 Jan 2025 20:47:35 +0000 (20:47 +0000)
commit4e36eec244507430991971466d79891e7fd3a7d7
tree8fab7d27447916f7870f77c713a723d267de1edb
parentab4d68fc92e9160e8917edba72f5838023cedaa5
fruit: fixup size_t overflow check

https://bugzilla.samba.org/show_bug.cgi?id=13622 .
The check ('bandsize > SIZE_MAX/nbands' is wrong, since
it caps the total size to the wrong data type size_t
instead of off_t -- samba is always built with LFS support
so off_t is always 64bits, while size_t is 32bit son a
32bit platform.  This has caused issues already, capping
size of the bands: https://bugs.debian.org/974868 .

Since there's another overflow check already, let's just
fold this one to the following one and log a more complete
error message.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Sat Jan  4 20:47:35 UTC 2025 on atb-devel-224
source3/modules/vfs_fruit.c