don't die with a FPE if there are no DCs
authorAndrew Tridgell <tridge@samba.org>
Mon, 26 Nov 2001 09:28:27 +0000 (09:28 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 26 Nov 2001 09:28:27 +0000 (09:28 +0000)
(This used to be commit b5999473482475ef64212f4f7204c7895cf8fdf3)

source3/nsswitch/winbindd_cm.c

index a00bc3f5d9ff4d7244ecc5a523c4773d888bc7d3..9b810063c57975b2bec526c6ec227b130d0f18ac 100644 (file)
@@ -152,6 +152,8 @@ static BOOL cm_get_dc_name(char *domain, fstring srv_name)
                if(is_local_net(ip_list[i]))
                        goto got_ip;
        }
+
+       if (count == 0) return False;
        
        i = (sys_random() % count);