[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4536) ldap_sort_entries doesn't preserve result entry



Full_Name: Karsten Kuenne
Version: 2.3.21
OS: Solaris 8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (216.223.241.131)


If a program has the following call sequence it fails with "No results
returned":

ldap_search_s
ldap_sort_entries
ldap_parse_result

The reason is that ldap_sort_entries doesn't properly preserve the tail of the
chain and ldap_parse_result is looking for it.

The following small patch fixes it:

--- libraries/libldap/sort.c.orig       2006-05-10 17:19:34.671812000 -0400
+++ libraries/libldap/sort.c    2006-05-10 20:24:54.858485000 -0400
@@ -158,6 +158,8 @@
                LDAP_VFREE( et[i].et_vals );
        }
        *ep = ohead;
+       if ( otail )
+               (*chain)->lm_chain_tail = otail;

        LDAP_FREE( (char *) et );

Detected with ruby-ldap-0.9.5 which has the exact sequence.