mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Do not try to dereference bindpw if it is null
Fixes: https://fedorahosted.org/freeipa/ticket/783
This commit is contained in:
parent
01f907c01b
commit
8a6547943f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user