summaryrefslogtreecommitdiffstats
path: root/source/libads
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-11-29 08:22:45 +0000
committerAndrew Tridgell <tridge@samba.org>2001-11-29 08:22:45 +0000
commit2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979 (patch)
tree6296beea8f8fd4394abcb5f9c454beb028baf8ac /source/libads
parent5a5f140f84f4dd377d141e352f4cb7f9bea4fe64 (diff)
downloadsamba-2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979.tar.gz
samba-2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979.tar.xz
samba-2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979.zip
ads->realm must not be NULL
perhaps we should just fail ads_init() in this case?
Diffstat (limited to 'source/libads')
-rw-r--r--source/libads/ads_struct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/libads/ads_struct.c b/source/libads/ads_struct.c
index 84c12bf6652..4227684375e 100644
--- a/source/libads/ads_struct.c
+++ b/source/libads/ads_struct.c
@@ -103,6 +103,8 @@ static char *find_ldap_server(ADS_STRUCT *ads)
{
char *list = NULL;
+ if (!ads->realm) return NULL;
+
if (ldap_domain2hostlist(ads->realm, &list) == LDAP_SUCCESS) {
char *p;
p = strchr(list, ':');
@@ -149,6 +151,7 @@ ADS_STRUCT *ads_init(const char *realm,
if (!ads->realm[0]) {
ads->realm = get_default_realm(ads);
}
+ if (!ads->realm) ads->realm = strdup("");
}
if (!ads->bind_path) {
ads->bind_path = ads_build_dn(ads->realm);