]> git.sur5r.net Git - openldap/commitdiff
ITS#7527 add missing error checks for corrupt index
authorHoward Chu <hyc@openldap.org>
Wed, 20 Feb 2013 02:19:47 +0000 (18:19 -0800)
committerHoward Chu <hyc@openldap.org>
Wed, 20 Feb 2013 02:19:47 +0000 (18:19 -0800)
servers/slapd/back-mdb/idl.c

index 2cba7c27590745a9fc66f457589d53eb558c5ede..eee2afc670aec0a9e2a83c53b273815dac689eef 100644 (file)
@@ -505,9 +505,17 @@ mdb_idl_insert_keys(
                        if ( id < lo || id > hi ) {
                                /* position on lo */
                                rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP );
+                               if ( rc != 0 ) {
+                                       err = "c_get lo";
+                                       goto fail;
+                               }
                                if ( id > hi ) {
                                        /* position on hi */
                                        rc = mdb_cursor_get( cursor, &key, &data, MDB_NEXT_DUP );
+                                       if ( rc != 0 ) {
+                                               err = "c_get hi";
+                                               goto fail;
+                                       }
                                }
                                data.mv_size = sizeof(ID);
                                data.mv_data = &id;