From: Pavel Filipenský Date: Thu, 2 Jan 2025 17:25:22 +0000 (+0100) Subject: s3:vfs_fruit: Fix crash for nbands == 0 X-Git-Tag: tdb-1.4.13~235 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab4d68fc92e9160e8917edba72f5838023cedaa5;p=thirdparty%2Fsamba.git s3:vfs_fruit: Fix crash for nbands == 0 Signed-off-by: Pavel Filipenský Reviewed-by: Ralph Boehme --- diff --git a/selftest/knownfail b/selftest/knownfail index 7ae2ac1bc5e..51aae99d6b4 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -4,7 +4,6 @@ # "make test" will not report failures for tests listed here and will consider # a successful run for any of these tests an error. -^samba3.vfs.fruit_timemachine # this fails as number of band==0 causes divison by 0 ^samba3.blackbox.failure.failure # this is designed to fail, for testing our test infrastructure .*driver.add_driver_timestamps # we only can store dates, not timestamps ^samba3.smbtorture_s3.crypt_server\(nt4_dc\).SMB2-SESSION-REAUTH # expected to give ACCESS_DENIED SMB2.1 doesn't have encryption diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 9d1e8badd61..76ad0133186 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -5213,7 +5213,7 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle, TALLOC_FREE(bands_dir); *_nbands = nbands; - return true; + return nbands > 0; } static bool fruit_tmsize_do_dirent(vfs_handle_struct *handle,