diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-01-17 18:42:21 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-01-18 11:56:03 -0500 |
commit | 8a6547943fc56a9b08b079b11cfaa6579b4eb011 (patch) | |
tree | 138877d919e867445d111fd2e19c0ea9a7b39a4f /ipa-client/ipa-join.c | |
parent | 01f907c01b4e75c87b0459b0fd096635a9e03b94 (diff) | |
download | freeipa-8a6547943fc56a9b08b079b11cfaa6579b4eb011.tar.gz freeipa-8a6547943fc56a9b08b079b11cfaa6579b4eb011.tar.xz freeipa-8a6547943fc56a9b08b079b11cfaa6579b4eb011.zip |
Do not try to dereference bindpw if it is null
Fixes: https://fedorahosted.org/freeipa/ticket/783
Diffstat (limited to 'ipa-client/ipa-join.c')
-rw-r--r-- | 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 d23348954..86b1bd122 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); |