s3: dfs: Fix a crash when the dfs targets are disabled.
authorHar Gagan Sahai <SHarGagan@novell.com>
Thu, 10 Sep 2015 10:34:27 +0000 (16:04 +0530)
committerJeremy Allison <jra@samba.org>
Fri, 11 Sep 2015 04:39:19 +0000 (06:39 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11509

Signed-off-by: Har Gagan Sahai <SHarGagan@novell.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@wakeful.net>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 11 06:39:19 CEST 2015 on sn-devel-104

source3/libsmb/clidfs.c

index bd587bc62b627e08d74b10256323e14d424c4abd..2121ad09f3459e40281b9115a7b93e26c34e4847 100644 (file)
@@ -958,11 +958,11 @@ 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;
        }