mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Fix ldap_int_get_controls for optional values
This commit is contained in:
parent
cb73d243fb
commit
e37ccca9aa
1 changed files with 6 additions and 12 deletions
|
|
@ -187,33 +187,27 @@ int ldap_int_get_controls(
|
|||
|
||||
tag = ber_scanf( ber, "{a" /*}*/, &tctrl->ldctl_oid );
|
||||
|
||||
if( tag != LBER_ERROR ) {
|
||||
tag = ber_peek_tag( ber, &len );
|
||||
if( tag == LBER_ERROR ) {
|
||||
*ctrls = NULL;
|
||||
ldap_controls_free( tctrls );
|
||||
return LDAP_DECODING_ERROR;
|
||||
}
|
||||
|
||||
tag = ber_peek_tag( ber, &len );
|
||||
|
||||
if( tag == LBER_BOOLEAN ) {
|
||||
ber_int_t crit;
|
||||
tag = ber_scanf( ber, "b", &crit );
|
||||
tctrl->ldctl_iscritical = crit ? (char) 0 : (char) ~0;
|
||||
}
|
||||
|
||||
if( tag != LBER_ERROR ) {
|
||||
tag = ber_peek_tag( ber, &len );
|
||||
}
|
||||
|
||||
if( tag == LBER_OCTETSTRING ) {
|
||||
tag = ber_scanf( ber, "o", &tctrl->ldctl_value );
|
||||
|
||||
} else {
|
||||
tctrl->ldctl_value.bv_val = NULL;
|
||||
}
|
||||
|
||||
if( tag == LBER_ERROR ) {
|
||||
*ctrls = NULL;
|
||||
ldap_controls_free( tctrls );
|
||||
return LDAP_DECODING_ERROR;
|
||||
}
|
||||
|
||||
*ctrls = tctrls;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue