From: Alfred Gebert Date: Fri, 5 Nov 2010 14:53:41 +0000 (+0100) Subject: LDAP: detect non-binary attributes properly X-Git-Tag: upstream/7.37.1~4606 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a07e704ca7f815c38bba0dc5277a8d729cfc75b;p=platform%2Fupstream%2Fcurl.git 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* --- 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;