summaryrefslogtreecommitdiff
path: root/usr.bin/ldap/ldapclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ldap/ldapclient.c')
-rw-r--r--usr.bin/ldap/ldapclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ldap/ldapclient.c b/usr.bin/ldap/ldapclient.c
index 98c98085773..51a6c51e487 100644
--- a/usr.bin/ldap/ldapclient.c
+++ b/usr.bin/ldap/ldapclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapclient.c,v 1.6 2018/11/06 14:14:12 martijn Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.7 2018/11/06 14:15:29 martijn Exp $ */
/*
* Copyright (c) 2018 Reyk Floeter <reyk@openbsd.org>
@@ -426,7 +426,7 @@ ldapc_printattr(struct ldapc *ldap, const char *key, const char *value)
}
} else {
inlen = strlen(value);
- outlen = inlen * 2 + 1;
+ outlen = (((inlen + 2) / 3) * 4) + 1;
if ((out = calloc(1, outlen)) == NULL ||
b64_ntop(value, inlen, out, outlen) == -1) {