mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
Support zero-length entries
This commit is contained in:
parent
b72b573899
commit
738f31a83a
1 changed files with 7 additions and 4 deletions
|
|
@ -122,13 +122,16 @@ int mdb_id2entry(
|
|||
rc = entry_header( &eh );
|
||||
if ( rc ) return rc;
|
||||
|
||||
eh.bv.bv_len = eh.nvals * sizeof( struct berval );
|
||||
eh.bv.bv_val = ch_malloc( eh.bv.bv_len );
|
||||
rc = entry_decode(&eh, e);
|
||||
if ( eh.nvals ) {
|
||||
eh.bv.bv_len = eh.nvals * sizeof( struct berval );
|
||||
eh.bv.bv_val = ch_malloc( eh.bv.bv_len );
|
||||
rc = entry_decode(&eh, e);
|
||||
} else {
|
||||
*e = entry_alloc();
|
||||
}
|
||||
|
||||
if( rc == 0 ) {
|
||||
(*e)->e_id = id;
|
||||
(*e)->e_bv = eh.bv;
|
||||
(*e)->e_name.bv_val = NULL;
|
||||
(*e)->e_nname.bv_val = NULL;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue