mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
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> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
34383981a0
commit
42f0f57eb8
@ -353,7 +353,7 @@ static int ldb_wildcard_compare(struct ldb_context *ldb,
|
||||
}
|
||||
|
||||
/* last chunk may not have reached end of string */
|
||||
if ( (! tree->u.substring.end_with_wildcard) && (*(val.data) != 0) ) goto mismatch;
|
||||
if ( (! tree->u.substring.end_with_wildcard) && (val.length != 0) ) goto mismatch;
|
||||
talloc_free(save_p);
|
||||
*matched = true;
|
||||
return LDB_SUCCESS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user