]> git.sur5r.net Git - openldap/commitdiff
handle abnormal condition
authorPierangelo Masarati <ando@openldap.org>
Thu, 23 Mar 2006 18:36:10 +0000 (18:36 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 23 Mar 2006 18:36:10 +0000 (18:36 +0000)
libraries/libldap/error.c

index 825c4ec0d032a40d6ff860bd2fc2172d2ca99c58..c80465ecbdb1819320be31f57c71331a1a227af7 100644 (file)
@@ -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 ) {