]> git.sur5r.net Git - openldap/commitdiff
Return LDAP_BAD_PARAM if res is not EXOP result.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 28 Jun 1999 22:17:38 +0000 (22:17 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 28 Jun 1999 22:17:38 +0000 (22:17 +0000)
Skip over referrals that might exist in EXOP result.

libraries/libldap/extended.c

index e92d4d25783b12cd8339298b29c5d0ded2a46265..4f3f464562fefe8bc7ef1c92b5487af0c8d327cf 100644 (file)
@@ -170,6 +170,11 @@ ldap_parse_extended_result (
                return ld->ld_errno;
        }
 
+       if( res->lm_msgtype == LDAP_RES_EXTENDED ) {
+               ld->ld_errno = LDAP_PARAM_ERROR;
+               return ld->ld_errno;
+       }
+
        if( retoidp != NULL ) *retoidp = NULL;
        if( retdatap != NULL ) *retdatap = NULL;
 
@@ -199,6 +204,15 @@ ldap_parse_extended_result (
 
        tag = ber_peek_tag( ber, &len );
 
+       if( tag == LDAP_TAG_REFERRAL ) {
+               /* skip over referral */
+               tag = ber_scanf( ber, "x" );
+
+               if( tag != LBER_ERROR ) {
+                       tag = ber_peek_tag( ber, &len );
+               }
+       }
+
        if( tag == LDAP_TAG_EXOP_RES_OID ) {
                /* we have a resoid */
                if( ber_scanf( ber, "a", &resoid ) == LBER_ERROR ) {