CVE-2019-3824 ldb: wildcard_match end of data check
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 18 Feb 2019 21:26:56 +0000 (10:26 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Feb 2019 06:50:16 +0000 (07:50 +0100)
commit2a88a47b9f8460be4b46d4dce7ac9fc4a53c86a7
tree9d9a60c9222ebcbe7c919dcb0940ce5cb76bb9cc
parent73187de71382e48c7eba595aad2fa69dca020a7d
CVE-2019-3824 ldb: wildcard_match end of data check

ldb_handler_copy and ldb_val_dup over allocate by one and add a trailing '\0'
to the data, to make them safe to use the C string functions on.

However testing for the trailing '\0' is not the correct way to test for
the end of a value, the length should be checked instead.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/common/ldb_match.c