From: Pierangelo Masarati Date: Thu, 23 Mar 2006 18:36:10 +0000 (+0000) Subject: handle abnormal condition X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~116 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70211e9be5c230b97f6b49b2f75618b5cbf5325e;p=openldap handle abnormal condition --- diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index 825c4ec0d0..c80465ecbd 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -281,10 +281,19 @@ ldap_parse_result( #endif /* Find the result, last msg in chain... */ lm = r->lm_chain_tail; - if ((lm->lm_msgtype == LDAP_RES_SEARCH_ENTRY) || - (lm->lm_msgtype == LDAP_RES_SEARCH_REFERENCE) || - (lm->lm_msgtype == LDAP_RES_INTERMEDIATE)) { - lm = NULL; + /* FIXME: either this is not possible (assert?) + * or it should be handled */ + if ( lm != NULL ) { + switch ( lm->lm_msgtype ) { + case LDAP_RES_SEARCH_ENTRY: + case LDAP_RES_SEARCH_REFERENCE: + case LDAP_RES_INTERMEDIATE: + lm = NULL; + break; + + default: + break; + } } if( lm == NULL ) {