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

Bug in ldap_parse_result function (ITS#643)



The following is against the development branch of the tree

If a user is using ldap result to obtain search results one message at a
time
and calls ldap_parse_result on one of those messages, i.e. the message
chain does not have an LDAP_RES_SEARCH_RESULT message
in the chain, ldap_parse_result returns a LDAP_DECODING_ERROR
instead of LDAP_NO_RESULTS_RETURNED.

The following patch corrects that problem:

--- error.c     2000/07/04 19:49:01     1.33
+++ error.c     2000/07/27 21:06:48
@@ -231,7 +231,7 @@
        if(serverctrls != NULL) *serverctrls = NULL;

        /* Find the next result... */
-       for ( lm = r; lm->lm_chain != NULL; lm = lm->lm_chain ) {
+       for ( lm = r; lm != NULL; lm = lm->lm_chain ) {
                /* skip over entries and references */
                if( lm->lm_msgtype != LDAP_RES_SEARCH_ENTRY &&
                        lm->lm_msgtype != LDAP_RES_SEARCH_REFERENCE &&