Fix a ipa-join segfault due to improper handling of NULL credentials. Fixes ticket #783.
Simo. -- Simo Sorce * Red Hat, Inc * New York
>From 16ee251376ed9817ceb59b57b64ce5f0720f43e9 Mon Sep 17 00:00:00 2001 From: Simo Sorce <sso...@redhat.com> Date: Mon, 17 Jan 2011 18:42:21 -0500 Subject: [PATCH] Do not try to dereference bindpw if it is null Fixes: https://fedorahosted.org/freeipa/ticket/783 --- ipa-client/ipa-join.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ipa-client/ipa-join.c b/ipa-client/ipa-join.c index d23348954d85b68a362ce3bbebc4180fce4005c3..86b1bd122064ebe4832225cfa2bc65f80a69da00 100644 --- a/ipa-client/ipa-join.c +++ b/ipa-client/ipa-join.c @@ -213,8 +213,13 @@ connect_ldap(const char *hostname, const char *binddn, const char *bindpw) { goto fail; } - bindpw_bv.bv_val = discard_const(bindpw); - bindpw_bv.bv_len = strlen(bindpw); + if (bindpw) { + bindpw_bv.bv_val = discard_const(bindpw); + bindpw_bv.bv_len = strlen(bindpw); + } else { + bindpw_bv.bv_val = NULL; + bindpw_bv.bv_len = 0; + } ret = ldap_sasl_bind_s(ld, binddn, LDAP_SASL_SIMPLE, &bindpw_bv, NULL, NULL, NULL); -- 1.7.3.4
_______________________________________________ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel