]> git.sur5r.net Git - openldap/commitdiff
ITS#7681 fix 18a07eb7c2dc33372455a6040984cd6b699b41a5
authorHoward Chu <hyc@symas.com>
Sun, 15 Sep 2013 20:08:29 +0000 (13:08 -0700)
committerHoward Chu <hyc@symas.com>
Sat, 21 Sep 2013 21:51:01 +0000 (14:51 -0700)
Set rc=0 when taking the SET_RANGE branch

libraries/liblmdb/mdb.c

index e5313b0c8516609aa9d78e423f93743127a2b325..e30d85c476d6d2fe4ed15bc230297ae6d54cc817 100644 (file)
@@ -5231,9 +5231,10 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
                if (!mc->mc_top) {
                        /* There are no other pages */
                        mc->mc_ki[mc->mc_top] = 0;
-                       if (op == MDB_SET_RANGE)
+                       if (op == MDB_SET_RANGE) {
+                               rc = 0;
                                goto set1;
-                       else 
+                       } else
                                return MDB_NOTFOUND;
                }
        }
@@ -5298,6 +5299,7 @@ set1:
                        if (rc) {
                                if (op == MDB_GET_BOTH || rc > 0)
                                        return MDB_NOTFOUND;
+                               rc = 0;
                        }
 
                } else {