From: Kurt Zeilenga Date: Mon, 1 Oct 2001 18:17:15 +0000 (+0000) Subject: Sync assert() checks with HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_0_16~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081b147e23d37915c7a8929ca93d67368fde1db1;p=thirdparty%2Fopenldap.git Sync assert() checks with HEAD --- diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 015f406f57..64948f8dd5 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -87,10 +87,16 @@ access_allowed( #endif slap_mask_t mask; slap_control_t control; + const char *attr; + regmatch_t matches[MAXREMATCHES]; - const char *attr = desc ? desc->ad_cname->bv_val : NULL; + assert( e != NULL ); + assert( desc != NULL ); + assert( access > ACL_NONE ); - regmatch_t matches[MAXREMATCHES]; + attr = desc->ad_cname->bv_val; + + assert( attr != NULL ); Debug( LDAP_DEBUG_ACL, "=> access_allowed: %s access to \"%s\" \"%s\" requested\n", @@ -231,8 +237,10 @@ acl_get( assert( e != NULL ); assert( count != NULL ); + assert( desc != NULL ); - attr = desc ? desc->ad_cname->bv_val : NULL; + attr = desc->ad_cname->bv_val; + assert( attr != NULL ); if( a == NULL ) { if( be == NULL ) { @@ -363,10 +371,15 @@ acl_mask( #ifdef LDAP_DEBUG char accessmaskbuf[ACCESSMASK_MAXLEN]; #endif - const char *attr = desc ? desc->ad_cname->bv_val : NULL; + const char *attr; assert( a != NULL ); assert( mask != NULL ); + assert( desc != NULL ); + + attr = desc->ad_cname->bv_val; + + assert( attr != NULL ); Debug( LDAP_DEBUG_ACL, "=> acl_mask: access to entry \"%s\", attr \"%s\" requested\n", @@ -547,11 +560,12 @@ acl_mask( struct berval bv; int rc, match = 0; const char *text; - const char *desc = b->a_dn_at->ad_cname->bv_val; + const char *attr = b->a_dn_at->ad_cname->bv_val; - Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n", - desc, 0, 0); + assert( attr != NULL ); + Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n", + attr, 0, 0); bv.bv_val = op->o_ndn; bv.bv_len = strlen( bv.bv_val ); @@ -1352,6 +1366,8 @@ aci_mask( int rc; char *attr = desc->ad_cname->bv_val; + assert( attr != NULL ); + /* parse an aci of the form: oid#scope#action;rights;attr;rights;attr$action;rights;attr;rights;attr#dnType#subjectDN