]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: vfs_dirsort module.
authorJeremy Allison <jra@samba.org>
Wed, 3 Sep 2014 14:54:51 +0000 (07:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 11 Sep 2014 17:55:17 +0000 (19:55 +0200)
Fix an off-by-one check that would cause seekdir to
seek off the end of the cached array.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg.gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  3 19:59:54 CEST 2014 on sn-devel-104

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10794
vfs_dirsort has an off-by-one error that can cause uninitialized memory read

source3/modules/vfs_dirsort.c

index 72b46c9721d2fe571443b659672bf626cdd9f40e..1d46e4324bbc028318c51fb007f10a36c07f5465 100644 (file)
@@ -261,7 +261,7 @@ static void dirsort_seekdir(vfs_handle_struct *handle, DIR *dirp,
        if (data == NULL) {
                return;
        }
-       if (offset > data->number_of_entries) {
+       if (offset >= data->number_of_entries) {
                return;
        }
        data->pos = offset;