]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: Fix CID 1311244 Out-of-bounds read
authorVolker Lendecke <vl@samba.org>
Tue, 7 Jul 2015 07:04:22 +0000 (09:04 +0200)
committerRalph Böhme <slow@samba.org>
Tue, 7 Jul 2015 12:04:39 +0000 (14:04 +0200)
We should not call memcpy if the offset is exactly AFP_INFO_SIZE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul  7 14:04:39 CEST 2015 on sn-devel-104

source3/modules/vfs_fruit.c

index d05d7868d31257819fcd690f2f54a89f4154db8c..e29440b72432ec0a3907073649469de56ced2fba 100644 (file)
@@ -2624,7 +2624,7 @@ static ssize_t fruit_pread(vfs_handle_struct *handle,
                char afpinfo_buf[AFP_INFO_SIZE];
                size_t to_return;
 
-               if ((offset < 0) || (offset > AFP_INFO_SIZE)) {
+               if ((offset < 0) || (offset >= AFP_INFO_SIZE)) {
                        len = 0;
                        rc = 0;
                        goto exit;