]> git.sur5r.net Git - openldap/commitdiff
ITS#7377 Catch mdb_cursor_sibling() error
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 10 Dec 2016 21:00:31 +0000 (22:00 +0100)
committerHallvard Furuseth <hallvard@openldap.org>
Sat, 10 Dec 2016 21:00:31 +0000 (22:00 +0100)
libraries/liblmdb/mdb.c

index 5a3a829629a6e7a98a18dd75b2b5471e993187dc..42452c2894f057dcb9459a4acf955e69a18019af 100644 (file)
@@ -9548,7 +9548,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
                        } else {
                                /* find right page's left sibling */
                                mc->mc_ki[ptop] = mn.mc_ki[ptop];
-                               mdb_cursor_sibling(mc, 0);
+                               rc = mdb_cursor_sibling(mc, 0);
                        }
                }
        } else {
@@ -9557,6 +9557,8 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno
                mn.mc_top++;
        }
        if (rc != MDB_SUCCESS) {
+               if (rc == MDB_NOTFOUND) /* improper mdb_cursor_sibling() result */
+                       rc = MDB_PROBLEM;
                goto done;
        }
        if (nflags & MDB_APPEND) {