Issue 643 - Bug in ldap_parse_result function
Summary: Bug in ldap_parse_result function
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-07-27 21:18 UTC by Steve Sonntag
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Steve Sonntag 2000-07-27 21:18:21 UTC
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 &&

Comment 1 Kurt Zeilenga 2000-07-27 22:29:08 UTC
Thanks, committed, please test.
        Kurt

At 09:19 PM 7/27/00 +0000, vtag@novell.com wrote:
>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 &&

Comment 2 Kurt Zeilenga 2000-07-30 08:36:25 UTC
changed notes
changed state Open to Closed
moved from Incoming to Development
Comment 3 OpenLDAP project 2014-08-01 21:05:27 UTC
Fixed.