ldb: Correct Pigeonhole principle validation in ldb_filter_attrs()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 26 Aug 2019 01:04:07 +0000 (13:04 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Aug 2019 23:59:36 +0000 (23:59 +0000)
commitb1eec5b196e3d5a5716a5c74cf669ceaa5c0301f
tree4873047b178bdfa834666c22b5ea1c6e19083f6d
parent41aaeaf1fe921311f183d5c08ff121a9ccc4c5b4
ldb: Correct Pigeonhole principle validation in ldb_filter_attrs()

Thankfully this only fails if the DB is corrupt and has a duplicate record.

The test was at the wrong end of the loop, and was for the
wrong boundary condition.  A write after the end of the array would
occour before the condition was hit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13695

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/common/ldb_pack.c
lib/ldb/tests/ldb_filter_attrs_test.c [new file with mode: 0644]
lib/ldb/wscript