r22425: Avoid to segfault if we only have the realm.
authorSimo Sorce <idra@samba.org>
Sat, 21 Apr 2007 20:43:54 +0000 (20:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:34 +0000 (12:19 -0500)
source/libsmb/namequery_dc.c

index 110b9986b7fe12a1c0efaada75ed2a6a20d0547d..65e860d45e738e85e13d33581324eb2e22cf2dd0 100644 (file)
@@ -215,6 +215,11 @@ BOOL get_dc_name(const char *domain, const char *realm, fstring srv_name, struct
        if ( (our_domain && lp_security()==SEC_ADS) || realm ) {
                ret = ads_dc_name(domain, realm, &dc_ip, srv_name);
        }
+
+       if (!domain) {
+               /* if we have only the realm we can't do anything else */
+               return False;
+       }
        
        if (!ret) {
                /* fall back on rpc methods if the ADS methods fail */