]> git.sur5r.net Git - openldap/commitdiff
Fix IDL off-by-one
authorHoward Chu <hyc@symas.com>
Sun, 28 Aug 2011 07:51:42 +0000 (00:51 -0700)
committerHoward Chu <hyc@symas.com>
Sun, 28 Aug 2011 07:51:42 +0000 (00:51 -0700)
servers/slapd/back-mdb/idl.c

index 3655377e7c1d11f6d2a5f08740e972733ae23e84..b020931d3645b79eeab9f2ea76e6331ad3d69ee8 100644 (file)
@@ -341,7 +341,7 @@ mdb_idl_fetch_key(
                        rc = mdb_cursor_get( cursor, key, &data, MDB_NEXT_MULTIPLE );
                }
                if ( rc == MDB_NOTFOUND ) rc = 0;
-               ids[0] = i - ids;
+               ids[0] = i - &ids[1];
                /* On disk, a range is denoted by 0 in the first element */
                if (ids[1] == 0) {
                        if (ids[0] != MDB_IDL_RANGE_SIZE) {