summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldapd/ber.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ldapd/ber.c')
-rw-r--r--usr.sbin/ldapd/ber.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/ber.c b/usr.sbin/ldapd/ber.c
index 02d1b7d2020..2a3988db5ce 100644
--- a/usr.sbin/ldapd/ber.c
+++ b/usr.sbin/ldapd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.13 2018/02/08 18:02:06 jca Exp $ */
+/* $OpenBSD: ber.c,v 1.14 2018/06/27 13:22:17 rob Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -874,7 +874,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);