From: Howard Chu Date: Sat, 3 Sep 2011 20:09:19 +0000 (-0700) Subject: Fix conversion of IDL to range X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d38ef26425e2e239eb450b7d1642b12d7a396085;p=openldap Fix conversion of IDL to range --- diff --git a/servers/slapd/back-mdb/idl.c b/servers/slapd/back-mdb/idl.c index cc181235a2..53d130b705 100644 --- a/servers/slapd/back-mdb/idl.c +++ b/servers/slapd/back-mdb/idl.c @@ -445,14 +445,15 @@ mdb_idl_insert_key( err = "c_get next_nodup"; goto fail; } + key2 = *key; if ( rc == MDB_NOTFOUND ) { - rc = mdb_cursor_get( cursor, key, &data, MDB_LAST ); + rc = mdb_cursor_get( cursor, &key2, &data, MDB_LAST ); if ( rc != 0 ) { err = "c_get last"; goto fail; } } else { - rc = mdb_cursor_get( cursor, key, &data, MDB_PREV ); + rc = mdb_cursor_get( cursor, &key2, &data, MDB_PREV ); if ( rc != 0 ) { err = "c_get prev"; goto fail; @@ -467,7 +468,7 @@ mdb_idl_insert_key( hi = id; } /* delete the old key */ - rc = mdb_del( txn, dbi, key, NULL ); + rc = mdb_del( txn, dbi, &key2, NULL ); if ( rc != 0 ) { err = "mdb_del"; goto fail;