From 3a921f37b737cab0729cc904e514647406e6f01c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 29 Nov 2001 08:22:45 +0000 Subject: ads->realm must not be NULL perhaps we should just fail ads_init() in this case? (This used to be commit 2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979) --- source3/libads/ads_struct.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3') diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 84c12bf665..4227684375 100644 --- a/source3/libads/ads_struct.c +++ b/source3/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); -- cgit