smbd: s3-dsgetdcname: handle num_ips == 0
authorRalph Boehme <slow@samba.org>
Fri, 26 Nov 2021 10:59:45 +0000 (11:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 3 Dec 2021 12:54:04 +0000 (12:54 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14923

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Dec  3 12:54:04 UTC 2021 on sn-devel-184

source3/libsmb/dsgetdcname.c

index f8ae96109b716adecd9be858ef225c8bb514c9c9..5954e48d747bd5d72a47fced6ececb9e4bb4176f 100644 (file)
@@ -572,6 +572,10 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
        for (i = 0; i < numdcs; i++) {
                size_t j;
 
+               if (dcs[i].num_ips == 0) {
+                       continue;
+               }
+
                dclist[ret_count].hostname =
                        talloc_move(dclist, &dcs[i].hostname);