mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
check for bogus params to an LDAP routine (ITS#5817)
This commit is contained in:
parent
2f32c29e4a
commit
2eeefd4985
1 changed files with 23 additions and 0 deletions
|
|
@ -151,9 +151,32 @@ ldap_add_ext(
|
||||||
/* for each attribute in the entry... */
|
/* for each attribute in the entry... */
|
||||||
for ( i = 0; attrs[i] != NULL; i++ ) {
|
for ( i = 0; attrs[i] != NULL; i++ ) {
|
||||||
if ( ( attrs[i]->mod_op & LDAP_MOD_BVALUES) != 0 ) {
|
if ( ( attrs[i]->mod_op & LDAP_MOD_BVALUES) != 0 ) {
|
||||||
|
int j;
|
||||||
|
|
||||||
|
if ( attrs[i]->mod_bvalues == NULL ) {
|
||||||
|
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||||
|
ber_free( ber, 1 );
|
||||||
|
return ld->ld_errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( j = 0; attrs[i]->mod_bvalues[ j ] != NULL; j++ ) {
|
||||||
|
if ( attrs[i]->mod_bvalues[ j ]->bv_val == NULL ) {
|
||||||
|
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||||
|
ber_free( ber, 1 );
|
||||||
|
return ld->ld_errno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rc = ber_printf( ber, "{s[V]N}", attrs[i]->mod_type,
|
rc = ber_printf( ber, "{s[V]N}", attrs[i]->mod_type,
|
||||||
attrs[i]->mod_bvalues );
|
attrs[i]->mod_bvalues );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if ( attrs[i]->mod_values == NULL ) {
|
||||||
|
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||||
|
ber_free( ber, 1 );
|
||||||
|
return ld->ld_errno;
|
||||||
|
}
|
||||||
|
|
||||||
rc = ber_printf( ber, "{s[v]N}", attrs[i]->mod_type,
|
rc = ber_printf( ber, "{s[v]N}", attrs[i]->mod_type,
|
||||||
attrs[i]->mod_values );
|
attrs[i]->mod_values );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue