From d4a819c6a44525ee42bc673bc51d4d175cd3f6f1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 10 Sep 2002 03:29:31 +0000 Subject: [PATCH] Add other half of ITS#2055 b64 len fix --- CHANGES | 2 +- include/lutil.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a63fc39b76..8550bdf216 100644 --- a/CHANGES +++ b/CHANGES @@ -10,7 +10,7 @@ OpenLDAP 2.1.5 Engineering Fixed slapd one-level search with subordinates Fixed libldap DNS SRV buffer size bug Fixed liblber write bugs (ITS#1983) - Fixed liblutil b64 decode len bug (ITS#2055) + Fixed liblutil b64 length bugs (ITS#2055) Added slapadd lastmod attribute support Added ldap tools passfile (-y) support (ITS#2031) Added ldapmodify LDIFv1 control: support (ITS#2060) diff --git a/include/lutil.h b/include/lutil.h index cae38a3430..339a4ad384 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -23,9 +23,9 @@ LDAP_BEGIN_DECL /* n octets encode into ceiling(n/3) * 4 bytes */ -/* Avoid floating point math by through extra padding */ +/* Avoid floating point math through extra padding */ -#define LUTIL_BASE64_ENCODE_LEN(n) ((n)/3 * 4 + 4) +#define LUTIL_BASE64_ENCODE_LEN(n) (((n)+2)/3 * 4) #define LUTIL_BASE64_DECODE_LEN(n) (((n)+3)/4 * 3) /* ISC Base64 Routines */ -- 2.39.5