From: Simo Sorce Date: Sat, 21 Apr 2007 20:43:54 +0000 (+0000) Subject: r22425: Avoid to segfault if we only have the realm. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~640 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ace1520270d19d41c24236d4e26ccf77071ebeb9;p=thirdparty%2Fsamba.git r22425: Avoid to segfault if we only have the realm. --- diff --git a/source/libsmb/namequery_dc.c b/source/libsmb/namequery_dc.c index 110b9986b7f..65e860d45e7 100644 --- a/source/libsmb/namequery_dc.c +++ b/source/libsmb/namequery_dc.c @@ -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 */