s4-ldb: when taking a list intersection, the result can be as long as the first list
authorAndrew Tridgell <tridge@samba.org>
Wed, 21 Oct 2009 11:33:58 +0000 (22:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 22 Oct 2009 01:47:53 +0000 (12:47 +1100)
Intuitively you would think it couldn't be longer than the minimum of
the two lists, but we are deliberately allowing for duplicates at this
level of the indexing code, which means the result can be longer

source4/lib/ldb/ldb_tdb/ldb_index.c

index 73bf40442a470dda2040386d9cb7faee7b88693a..709a2e1626df067e7b154c31e1d0e60ea0fdd554 100644 (file)
@@ -518,7 +518,7 @@ static bool list_intersect(struct ldb_context *ldb,
                return false;
        }
 
                return false;
        }
 
-       list3->dn = talloc_array(list3, struct ldb_val, MIN(list->count, list2->count));
+       list3->dn = talloc_array(list3, struct ldb_val, list->count);
        if (!list3->dn) {
                talloc_free(list3);
                return false;
        if (!list3->dn) {
                talloc_free(list3);
                return false;