summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_dirsort.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c
index 813955684a..6fe7c18414 100644
--- a/source3/modules/vfs_dirsort.c
+++ b/source3/modules/vfs_dirsort.c
@@ -61,6 +61,10 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)
data->number_of_entries++;
}
+ if (data->number_of_entries == 0) {
+ return false;
+ }
+
/* Open the underlying directory and count the number of entries
Skip back to the beginning as we'll read it again */
SMB_VFS_NEXT_REWINDDIR(handle, data->source_directory);