mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 23:59:34 -05:00
Do not crash when more than one attribute is passed to
slapi_search_internal_bind()
This commit is contained in:
parent
750cbb7026
commit
17f2953e40
1 changed files with 2 additions and 1 deletions
|
|
@ -1119,7 +1119,7 @@ slapi_search_internal_bind(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
an = (AttributeName *)slapi_ch_calloc(1, sizeof(AttributeName));
|
an = (AttributeName *)slapi_ch_calloc( (i + 1), sizeof(AttributeName) );
|
||||||
for (i = 0; attrs[i] != 0; i++) {
|
for (i = 0; attrs[i] != 0; i++) {
|
||||||
an[i].an_desc = NULL;
|
an[i].an_desc = NULL;
|
||||||
an[i].an_oc = NULL;
|
an[i].an_oc = NULL;
|
||||||
|
|
@ -1127,6 +1127,7 @@ slapi_search_internal_bind(
|
||||||
an[i].an_name.bv_len = slapi_strlen(attrs[i]);
|
an[i].an_name.bv_len = slapi_strlen(attrs[i]);
|
||||||
slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text );
|
slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text );
|
||||||
}
|
}
|
||||||
|
an[i].an_name.bv_val = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( scope == LDAP_SCOPE_BASE ) {
|
if ( scope == LDAP_SCOPE_BASE ) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue