summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-08-29 16:38:08 +0200
committerGünther Deschner <gd@samba.org>2013-08-29 18:54:28 +0200
commit91910fe898e2f8ad405c5790aa1a20e82a9f8aac (patch)
tree666b3335f9c7dd179939cbd55ad01cc79f83da90
parent9d08ac424cdf3166110370e94799693bdbb201af (diff)
downloadsamba-91910fe898e2f8ad405c5790aa1a20e82a9f8aac.tar.gz
samba-91910fe898e2f8ad405c5790aa1a20e82a9f8aac.tar.bz2
samba-91910fe898e2f8ad405c5790aa1a20e82a9f8aac.zip
s3:winbind: fail ads_cached_connection_connect() if realm == NULL
This prevents segfaults when e.g. a previous SMB_STRDUP failed.. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Aug 29 18:54:28 CEST 2013 on sn-devel-104
-rw-r--r--source3/winbindd/winbindd_ads.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index c33b1bc3bf..4c2638900f 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -86,6 +86,10 @@ static ADS_STATUS ads_cached_connection_connect(ADS_STRUCT **adsp,
struct sockaddr_storage dc_ss;
fstring dc_name;
+ if (realm == NULL) {
+ return ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL);
+ }
+
/* we don't want this to affect the users ccache */
setenv("KRB5CCNAME", WINBIND_CCACHE_NAME, 1);