summaryrefslogtreecommitdiff
path: root/libcli/ldap
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2020-04-03 12:18:03 +1300
committerGary Lockyer <gary@samba.org>2020-05-04 02:59:31 +0000
commitf467727db5ff6a6e58d9b590e4d443a1d974b679 (patch)
tree9269acc0655bcfee4676215c85f8c2ad79ef2744 /libcli/ldap
parent62621bd686a91328ae378cd56f9876c66be8eac4 (diff)
downloadsamba-f467727db5ff6a6e58d9b590e4d443a1d974b679.tar.gz
CVE-2020-10704: lib util asn1: Add ASN.1 max tree depth
Add maximum parse tree depth to the call to asn1_init, which will be used to limit the depth of the ASN.1 parse tree. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20454 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14334 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli/ldap')
-rw-r--r--libcli/ldap/ldap_message.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c
index f21598374a1..ba82bddeab1 100644
--- a/libcli/ldap/ldap_message.c
+++ b/libcli/ldap/ldap_message.c
@@ -390,7 +390,7 @@ _PUBLIC_ bool ldap_encode(struct ldap_message *msg,
const struct ldap_control_handler *control_handlers,
DATA_BLOB *result, TALLOC_CTX *mem_ctx)
{
- struct asn1_data *data = asn1_init(mem_ctx);
+ struct asn1_data *data = asn1_init(mem_ctx, ASN1_MAX_TREE_DEPTH);
int i, j;
if (!data) return false;