mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-03 21:50:49 -05:00
ITS#2364 fix unterminated AttributeName array
This commit is contained in:
parent
3f48cabdde
commit
1d772b3df6
1 changed files with 3 additions and 1 deletions
|
|
@ -1400,7 +1400,7 @@ slapi_send_ldap_search_entry(
|
|||
}
|
||||
|
||||
if ( i > 0 ) {
|
||||
an = (AttributeName *) ch_malloc( i * sizeof(AttributeName) );
|
||||
an = (AttributeName *) ch_malloc( (i+1) * sizeof(AttributeName) );
|
||||
for ( i = 0; attrs[i] != NULL; i++ ) {
|
||||
an[i].an_name.bv_val = ch_strdup( attrs[i] );
|
||||
an[i].an_name.bv_len = strlen( attrs[i] );
|
||||
|
|
@ -1408,6 +1408,8 @@ slapi_send_ldap_search_entry(
|
|||
if( slap_bv2ad( &an[i].an_name, &an[i].an_desc, &text ) != LDAP_SUCCESS)
|
||||
return -1;
|
||||
}
|
||||
an[i].an_name.bv_len = 0;
|
||||
an[i].an_name.bv_val = NULL;
|
||||
}
|
||||
|
||||
if ( ( rc = slapi_pblock_get( pb, SLAPI_BACKEND, (void *)&be ) != 0 ) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue