From: Kurt Zeilenga Date: Thu, 22 Jul 1999 05:06:41 +0000 (+0000) Subject: Fix unknown critical extensions. X-Git-Tag: OPENLDAP_REL_ENG_2_BP~63 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3f91cffa15f3167a53df560e8cb8de2b9342a83c;p=openldap Fix unknown critical extensions. --- diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 09267a8bb2..b4d76d73fb 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -26,7 +26,7 @@ int get_ctrls( Operation *op, int sendres ) { - int nctrls; + int nctrls = 0; ber_tag_t tag; ber_len_t len; char *opaque; @@ -40,7 +40,7 @@ int get_ctrls( if( len == 0) { /* no controls */ rc = LDAP_SUCCESS; - goto return_results; + return rc; } if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) { @@ -61,7 +61,6 @@ int get_ctrls( } /* set through each element */ - nctrls = 0; *ctrls = ch_malloc( 1 * sizeof(LDAPControl *) ); #if 0 @@ -123,9 +122,6 @@ int get_ctrls( goto return_results; } - Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: %s\n", - tctrl->ldctl_oid, 0, 0 ); - tag = ber_peek_tag( ber, &len ); if( tag == LBER_BOOLEAN ) { @@ -142,10 +138,15 @@ int get_ctrls( goto return_results; } - tctrl->ldctl_iscritical = crit ? (char) 0 : (char) ~0; + tctrl->ldctl_iscritical = (crit != 0); tag = ber_peek_tag( ber, &len ); } + Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: oid=\"%s\" (%scritical)\n", + tctrl->ldctl_oid, + tctrl->ldctl_iscritical ? "" : "non", + 0 ); + if( tag == LBER_OCTETSTRING ) { tag = ber_scanf( ber, "o", &tctrl->ldctl_value );