From 70f375eae070337011572c2896b148ec968b64aa Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 6 Dec 2004 07:16:57 +0000 Subject: [PATCH] Fix GE inequality lookups, key was getting overwritten --- servers/slapd/back-bdb/idl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 1e1453822d..74cfdc277d 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -489,13 +489,15 @@ bdb_idl_fetch_key( } /* If this is a LE lookup, save original key so we can determine - * when to stop + * when to stop. If this is a GE lookup, save the key since it + * will be overwritten. */ - if ( get_flag == LDAP_FILTER_LE ) { + if ( get_flag == LDAP_FILTER_LE || get_flag == LDAP_FILTER_GE ) { DBTzero( &key2 ); key2.flags = DB_DBT_USERMEM; key2.ulen = sizeof(keybuf); key2.data = keybuf; + key2.size = key->size; AC_MEMCPY( keybuf, key->data, key->size ); kptr = &key2; } else { -- 2.39.5