From: Howard Chu Date: Wed, 25 Jul 2012 19:31:08 +0000 (-0700) Subject: Append mode should also detect keys that are too small X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~57^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d3990eb2f8b2944782604a2ca7bd52e08c58fc3e;p=openldap Append mode should also detect keys that are too small --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 87d5feec7c..9ce45b30b8 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -4261,9 +4261,11 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data, rc = mdb_cursor_last(mc, &k2, &d2); if (rc == 0) { rc = mc->mc_dbx->md_cmp(key, &k2); - if (rc) { + if (rc > 0) { rc = MDB_NOTFOUND; mc->mc_ki[mc->mc_top]++; + } else { + rc = 0; } } } else {