]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup (coverity)
authorHoward Chu <hyc@openldap.org>
Wed, 14 Jan 2015 10:46:04 +0000 (10:46 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 14 Jan 2015 11:08:51 +0000 (11:08 +0000)
servers/slapd/overlays/constraint.c
servers/slapd/overlays/pcache.c
servers/slapd/overlays/rwmmap.c
servers/slapd/overlays/translucent.c

index 096f32aa79a225c7885c13af560b5e0a68c769af..33323e399d4225ba41563a9fde98d1003867e8fc 100644 (file)
@@ -980,16 +980,6 @@ constraint_update( Operation *op, SlapReply *rs )
        /* Do we need to count attributes? */
        for(cp = c; cp; cp = cp->ap_next) {
                if (cp->type == CONSTRAINT_COUNT) {
-                       if (rc != 0 || target_entry == NULL) {
-                               Debug(LDAP_DEBUG_TRACE, 
-                                       "==> constraint_update rc = %d DN=\"%s\"%s\n",
-                                       rc, op->o_req_ndn.bv_val,
-                                       target_entry ? "" : " not found" );
-                               if ( rc == 0 ) 
-                                       rc = LDAP_CONSTRAINT_VIOLATION;
-                               goto mod_violation;
-                       }
-
                        if (cp->restrict_lud && constraint_check_restrict(op, cp, target_entry) == 0) {
                                continue;
                        }
index 291dddf0f23bded80b13fbe34b41dab5875cc0ca..20f1558abfc3ad7735aa6704f3e7ebdbae57bdd5 100644 (file)
@@ -455,8 +455,11 @@ ftemp_attrs( struct berval *ftemp, struct berval *template,
                        *t1++ = *p1++;
 
                p2 = strchr( p1, '=' );
-               if ( !p2 )
+               if ( !p2 ) {
+                       if ( !descs )
+                               return -1;
                        break;
+               }
                i = p2 - p1;
                AC_MEMCPY( t1, p1, i );
                t1 += i;
index 4594353c98e471c608aacfcee7c91294bfb50d51..8f6ce66dbe0cf2dfa379c050160b10421d3ceb3c 100644 (file)
@@ -215,6 +215,7 @@ rwm_map_attrnames(
                return LDAP_NO_MEMORY;
        }
 
+       if ( an != NULL ) {
        for ( i = 0, j = 0; !BER_BVISNULL( &an[i].an_name ); i++ ) {
                struct ldapmapping      *m;
                int                     at_drop_missing = 0,
@@ -331,6 +332,7 @@ rwm_map_attrnames(
                        }
                }
        }
+       }
 
        if ( op->o_bd->be_extra_anlist != NULL ) {
                /* we assume be_extra_anlist are already mapped */
index a8846b10a1a404208605df5e918936cd15a8c215..b7de2cb3be11a00697c7778ed7cf0a6ad12f2d64 100644 (file)
@@ -420,12 +420,12 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
        op->o_bd = &ov->db;
        ov->db.be_acl = op->o_bd->be_acl;
        rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
+       op->o_bd = db;
        if(rc != LDAP_SUCCESS || re == NULL ) {
                send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
                        "attempt to modify nonexistent local record");
                return(rs->sr_err);
        }
-       op->o_bd = db;
 /*
 ** fetch entry from local backend;
 ** if it exists:
@@ -788,7 +788,7 @@ static int translucent_search_cb(Operation *op, SlapReply *rs) {
        if ( rs->sr_type == REP_RESULT && ( tc->step & USE_LIST ))
                return 0;
 
-       if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
+       if(rs->sr_type != REP_SEARCH || !rs->sr_entry)
                return(SLAP_CB_CONTINUE);
 
        Debug(LDAP_DEBUG_TRACE, "==> translucent_search_cb: %s\n",