diff options
author | rob <rob@cvs.openbsd.org> | 2018-06-27 13:22:18 +0000 |
---|---|---|
committer | rob <rob@cvs.openbsd.org> | 2018-06-27 13:22:18 +0000 |
commit | 54034ca4b88d51aca69a9cc9682a7b1981323de3 (patch) | |
tree | 67f9a9e0a29a7605e8ed57a6e6168786df1d25d1 /usr.bin/ldap | |
parent | 82aad79f5b94b07c4c1d0444fbd4a389e6d93456 (diff) |
Synchronize correct processing of BER_TYPE_EOC. Fixes support for empty LDAP
passwords. A similar fix was applied to snmpd in 2010 (rev 1.23).
Pointers from Reyk.
Ok claudio@
Diffstat (limited to 'usr.bin/ldap')
-rw-r--r-- | usr.bin/ldap/ber.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ldap/ber.c b/usr.bin/ldap/ber.c index eb7e3d8ab06..286a50d3a47 100644 --- a/usr.bin/ldap/ber.c +++ b/usr.bin/ldap/ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ber.c,v 1.1 2018/06/13 15:45:57 reyk Exp $ */ +/* $OpenBSD: ber.c,v 1.2 2018/06/27 13:22:17 rob Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net> @@ -861,7 +861,8 @@ ber_calc_len(struct ber_element *root) size += ber_calc_len(root->be_next); /* This is an empty element, do not use a minimal size */ - if (root->be_type == BER_TYPE_EOC && root->be_len == 0) + if (root->be_class == BER_CLASS_UNIVERSAL && + root->be_type == BER_TYPE_EOC && root->be_len == 0) return (0); return (root->be_len + size); |