mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
Check for the correct return code of cursor->c_get() (DB_BUFFER_SMALL)
This commit is contained in:
parent
b769f44619
commit
e1f068f712
2 changed files with 3 additions and 2 deletions
|
|
@ -130,6 +130,7 @@ int bdb_id2entry(
|
|||
rc = cursor->c_get( cursor, &key, &data, DB_SET );
|
||||
if ( rc ) goto leave;
|
||||
|
||||
|
||||
eh.bv.bv_val = buf;
|
||||
eh.bv.bv_len = data.size;
|
||||
rc = entry_header( &eh );
|
||||
|
|
@ -139,7 +140,7 @@ int bdb_id2entry(
|
|||
data.flags ^= DB_DBT_PARTIAL;
|
||||
data.ulen = 0;
|
||||
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
|
||||
if ( rc != ENOMEM ) goto leave;
|
||||
if ( rc != DB_BUFFER_SMALL ) goto leave;
|
||||
|
||||
/* Allocate a block and retrieve the data */
|
||||
off = eh.data - eh.bv.bv_val;
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
|
|||
data.flags ^= DB_DBT_PARTIAL;
|
||||
data.ulen = 0;
|
||||
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
|
||||
if ( rc != ENOMEM ) goto leave;
|
||||
if ( rc != DB_BUFFER_SMALL ) goto leave;
|
||||
|
||||
/* Allocate a block and retrieve the data */
|
||||
eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;
|
||||
|
|
|
|||
Loading…
Reference in a new issue