CVE-2023-0614 lib/ldb: Avoid allocation and memcpy() for every wildcard match candidate
commiteb20778b5e66c4e011c9c264ddb8d29180fe6e89
authorAndrew Bartlett <abartlet@samba.org>
Mon, 13 Mar 2023 01:25:56 +0000 (13 14:25 +1300)
committerJule Anger <janger@samba.org>
Mon, 20 Mar 2023 09:03:44 +0000 (20 10:03 +0100)
tree840913e7984c6393039e78de3e05cf0bc2386daa
parent1b775335f57ef3a939dc1d042e1e6d247fbd6850
CVE-2023-0614 lib/ldb: Avoid allocation and memcpy() for every wildcard match candidate

The value can be quite large, the allocation will take much
longer than the actual match and is repeated per candidate
record.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
(cherry picked from commit cad96f59a08192df927fb1df4e9787c7f70991a2)

[abartlet@samba.org Included in the security release as this
 makes the new large_ldap.py timeout test more reliable]
lib/ldb/common/ldb_match.c