]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ldap_get_ber_attribute_ber fix from HEAD
authorKurt Zeilenga <kurt@openldap.org>
Thu, 15 May 2003 23:10:30 +0000 (23:10 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 15 May 2003 23:10:30 +0000 (23:10 +0000)
CHANGES
libraries/libldap/getattr.c

diff --git a/CHANGES b/CHANGES
index 0edfea2e5fce4070743e609ef0e5b991f19376cd..bf03ade57820eef174a30715d4d47b722c88f82a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ OpenLDAP 2.1 Change Log
 OpenLDAP 2.1.20 Engineering
        Fixed slapd regex lookup mutex issue (ITS#2505)
        Fixed back-bdb/ldbm filter indexing bugs (ITS#2506) (ITS#2507)
+       Fixed libldap ldap_get_attribute_ber bug
 
 OpenLDAP 2.1.19 Release
        Fixed slapd substring index normalization (ITS#2468)
index 6e67e71c681434bf499c012023e3d0288727252e..bbe5020561e906c9478bf45fa94a67d21ffa268e 100644 (file)
@@ -121,7 +121,10 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
        return attr;
 }
 
-/* Fetch attribute type and optionally fetch values */
+/* Fetch attribute type and optionally fetch values. The type
+ * and values are referenced in-place from the BerElement, they are
+ * not dup'd into malloc'd memory.
+ */
 /* ARGSUSED */
 int
 ldap_get_attribute_ber( LDAP *ld, LDAPMessage *entry, BerElement *ber,
@@ -146,8 +149,11 @@ ldap_get_attribute_ber( LDAP *ld, LDAPMessage *entry, BerElement *ber,
        attr->bv_len = 0;
 
        if ( ber_pvt_ber_remaining( ber ) ) {
+               ber_len_t siz = sizeof( BerValue );
+
                /* skip sequence, snarf attribute type */
-               tag = ber_scanf( ber, vals ? "{mW}" : "{mx}", attr, vals ); 
+               tag = ber_scanf( ber, vals ? "{mM}" : "{mx}", attr, vals,
+                       &siz, 0 ); 
                if( tag == LBER_ERROR ) {
                        rc = ld->ld_errno = LDAP_DECODING_ERROR;
                }