From 6a07e704ca7f815c38bba0dc5277a8d729cfc75b Mon Sep 17 00:00:00 2001 From: Alfred Gebert Date: Fri, 5 Nov 2010 15:53:41 +0100 Subject: [PATCH] LDAP: detect non-binary attributes properly If the query result has a binary attribute, the binary attribute is base64 encoded. But all following non binary attributes are also base64 encoded which is wrong. This is a test (LDAP server is public). curl ldap://x500.bund.de:389/o=Bund,c=DE?userCertificate,certificateSerialNumber?sub ?cn=*Woehleke* --- lib/openldap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/openldap.c b/lib/openldap.c index 4d5db4a..ee4915f 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -499,6 +499,8 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf, if (bv.bv_len > 7 && !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7)) binary = 1; + else + binary = 0; for (i=0; bvals[i].bv_val != NULL; i++) { int binval = 0; -- 2.7.4