From 0ef9fe22f56ef3ff202f88426c3ee48c15e4a71e Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 26 Nov 2021 11:59:45 +0100 Subject: [PATCH] smbd: s3-dsgetdcname: handle num_ips == 0 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14923 Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Ralph Boehme Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner Reviewed-by: Jeremy Allison Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Dec 3 12:54:04 UTC 2021 on sn-devel-184 (cherry picked from commit 5e3df5f9ee64a80898f73585b19113354f463c44) --- source3/libsmb/dsgetdcname.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index f8ae96109b71..5954e48d747b 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -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); -- 2.33.1