]> git.sur5r.net Git - openldap/commitdiff
Append mode should also detect keys that are too small
authorHoward Chu <hyc@symas.com>
Wed, 25 Jul 2012 19:31:08 +0000 (12:31 -0700)
committerHoward Chu <hyc@symas.com>
Wed, 25 Jul 2012 19:31:08 +0000 (12:31 -0700)
libraries/libmdb/mdb.c

index 87d5feec7cafa6fb4a7209ad2a24ef4b054ed9a9..9ce45b30b81b7f6e712389c3336c1770d3385e8d 100644 (file)
@@ -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 {