From 770512e3bd785a977351ba82ab08c556573c79dd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Apr 2013 10:38:24 -0700 Subject: Check SMB_VFS_NEXT_OPENDIR return in dirsort_opendir(). Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider --- source3/modules/vfs_dirsort.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3') diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index d6f19b52ec..e2c61dab17 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -114,6 +114,11 @@ static DIR *dirsort_opendir(vfs_handle_struct *handle, data->source_directory = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); + if (data->source_directory == NULL) { + TALLOC_FREE(data); + return NULL; + } + data->fd = dirfd(data->source_directory); if (!open_and_sort_dir(handle, data)) { -- cgit