From 96ba682d537db198ea8f954ecad190bb7500b82c Mon Sep 17 00:00:00 2001 From: Har Gagan Sahai Date: Thu, 10 Sep 2015 16:04:27 +0530 Subject: [PATCH] Fix a crash when the dfs targets are disabled. Signed-off-by: Har Gagan Sahai --- source3/libsmb/clidfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index bd587bc..ceaa8ad 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -958,11 +958,12 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx, status = cli_dfs_get_referral(ctx, cli_ipc, dfs_path, &refs, &num_refs, &consumed); - if (!NT_STATUS_IS_OK(status) || !num_refs) { + if (!NT_STATUS_IS_OK(status)) { return status; } - if (!refs[0].dfspath) { + if (!num_refs || !refs[0].dfspath) { + return NT_STATUS_NOT_FOUND; } -- 1.8.4.5