]> git.sur5r.net Git - openldap/commitdiff
ITS#7473 fix b1a6f6980f2e5f17a39527069b27dfdc5ee73f8a
authorHoward Chu <hyc@openldap.org>
Wed, 30 Jan 2013 01:15:09 +0000 (17:15 -0800)
committerHoward Chu <hyc@openldap.org>
Wed, 30 Jan 2013 01:15:09 +0000 (17:15 -0800)
uninit'd size in dn2id_walk, bogus pagedresults

servers/slapd/back-mdb/dn2id.c
servers/slapd/back-mdb/search.c

index af003648af42abf76826590916927d34d9d82dbc..1f2c4ea33e77026a3490461ebc1ee28e1503fb2e 100644 (file)
@@ -835,6 +835,7 @@ mdb_dn2id_walk(
                                key.mv_data = &isc->scopes[n].mid;
                                key.mv_size = sizeof(ID);
                                data.mv_data = isc->nrdns[n].bv_val - 2;
+                               data.mv_size = 1;       /* just needs to be non-zero, mdb_dup_compare doesn't care */
                                mdb_cursor_get( isc->mc, &key, &data, MDB_GET_BOTH );
                                continue;
                        }
index 3ea6c5d9c53dc5c77e5456c4161dd42075fb275e..09bdf60c96111c61ecd065599841595e625ac4ea 100644 (file)
@@ -630,6 +630,7 @@ dn2entry_retry:
                }
                if ( id == (ID)ps->ps_cookie )
                        id = mdb_idl_next( candidates, &cursor );
+               nsubs = ncand;  /* always bypass scope'd search */
                goto loop_begin;
        }
        if ( nsubs < ncand ) {