From ab4d68fc92e9160e8917edba72f5838023cedaa5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Filipensk=C3=BD?= Date: Thu, 2 Jan 2025 18:25:22 +0100 Subject: [PATCH] s3:vfs_fruit: Fix crash for nbands == 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Filipenský Reviewed-by: Ralph Boehme --- selftest/knownfail | 1 - source3/modules/vfs_fruit.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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, -- 2.47.3