]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/ppolicy.c
fix comparison with string literal
[openldap] / servers / slapd / overlays / ppolicy.c
index 9a7abd0215120bc6effb7f3648efa9ff7fb892b7..e10cdac62b3b624e84a10267ed1bbd34d95feec1 100644 (file)
@@ -850,7 +850,7 @@ ctrls_cleanup( Operation *op, SlapReply *rs, LDAPControl **oldctrls )
        assert( rs->sr_ctrls[0] != NULL );
 
        for ( n = 0; rs->sr_ctrls[n]; n++ ) {
-               if ( rs->sr_ctrls[n]->ldctl_oid == LDAP_CONTROL_PASSWORDPOLICYRESPONSE ) {
+               if ( !strcmp( rs->sr_ctrls[n]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) ) {
                        ch_free( rs->sr_ctrls[n]->ldctl_value.bv_val );
                        ch_free( rs->sr_ctrls[n] );
                        rs->sr_ctrls[n] = (LDAPControl *)(-1);
@@ -2018,8 +2018,8 @@ ppolicy_parseCtrl(
        SlapReply *rs,
        LDAPControl *ctrl )
 {
-       if ( ctrl->ldctl_value.bv_len ) {
-               rs->sr_text = "passwordPolicyRequest control value not empty";
+       if ( !BER_BVISNULL( &ctrl->ldctl_value ) ) {
+               rs->sr_text = "passwordPolicyRequest control value not absent";
                return LDAP_PROTOCOL_ERROR;
        }
        op->o_ctrlflag[ppolicy_cid] = ctrl->ldctl_iscritical