From 81ecb0b1536785c830a264243c969e03a3858af6 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 18 Jul 2005 06:22:33 +0000 Subject: [PATCH] assert expects int. (int) can be 0. Use assert(arg!=0/NULL). --- libraries/liblber/memory.c | 2 +- libraries/libldap/cyrus.c | 6 +- libraries/libldap/error.c | 2 +- libraries/libldap/getdn.c | 136 +++++++++++------------ libraries/libldap/ppolicy.c | 2 +- libraries/libldap/result.c | 10 +- libraries/libldap/string.c | 4 +- libraries/libldap/url.c | 8 +- libraries/liblutil/ldif.c | 12 +- libraries/librewrite/context.c | 10 +- libraries/librewrite/ldapmap.c | 4 +- libraries/librewrite/map.c | 6 +- libraries/librewrite/rule.c | 8 +- libraries/librewrite/session.c | 2 +- libraries/librewrite/subst.c | 4 +- libraries/librewrite/xmap.c | 4 +- servers/slapd/acl.c | 4 +- servers/slapd/at.c | 6 +- servers/slapd/attr.c | 2 +- servers/slapd/back-bdb/cache.c | 2 +- servers/slapd/back-bdb/index.c | 2 +- servers/slapd/back-bdb/operational.c | 6 +- servers/slapd/back-bdb/search.c | 2 +- servers/slapd/back-bdb/tools.c | 8 +- servers/slapd/back-ldap/bind.c | 2 +- servers/slapd/back-ldap/chain.c | 4 +- servers/slapd/back-ldap/search.c | 2 +- servers/slapd/back-ldbm/alias.c | 2 +- servers/slapd/back-ldbm/cache.c | 16 +-- servers/slapd/back-ldbm/dn2id.c | 2 +- servers/slapd/back-ldbm/operational.c | 4 +- servers/slapd/back-ldbm/tools.c | 4 +- servers/slapd/back-meta/dncache.c | 12 +- servers/slapd/back-meta/map.c | 8 +- servers/slapd/back-meta/suffixmassage.c | 2 +- servers/slapd/back-monitor/conn.c | 4 +- servers/slapd/back-monitor/database.c | 4 +- servers/slapd/back-monitor/init.c | 6 +- servers/slapd/back-monitor/operation.c | 4 +- servers/slapd/back-monitor/operational.c | 6 +- servers/slapd/back-monitor/rww.c | 2 +- servers/slapd/back-monitor/sent.c | 6 +- servers/slapd/back-monitor/time.c | 4 +- servers/slapd/back-relay/init.c | 2 +- servers/slapd/back-sql/add.c | 2 +- servers/slapd/back-sql/api.c | 8 +- servers/slapd/back-sql/config.c | 6 +- servers/slapd/back-sql/entry-id.c | 12 +- servers/slapd/back-sql/init.c | 4 +- servers/slapd/back-sql/operational.c | 4 +- servers/slapd/back-sql/schema-map.c | 6 +- servers/slapd/back-sql/search.c | 6 +- servers/slapd/back-sql/sql-wrap.c | 4 +- servers/slapd/back-sql/util.c | 24 ++-- servers/slapd/backend.c | 10 +- servers/slapd/backover.c | 4 +- servers/slapd/config.c | 4 +- servers/slapd/cr.c | 8 +- servers/slapd/daemon.c | 6 +- servers/slapd/dn.c | 82 +++++++------- servers/slapd/filter.c | 4 +- servers/slapd/filterentry.c | 4 +- servers/slapd/limits.c | 22 ++-- servers/slapd/modify.c | 20 ++-- servers/slapd/mods.c | 4 +- servers/slapd/oc.c | 8 +- servers/slapd/operational.c | 2 +- servers/slapd/overlays/dynlist.c | 4 +- servers/slapd/overlays/glue.c | 6 +- servers/slapd/overlays/ppolicy.c | 4 +- servers/slapd/overlays/rwm.c | 10 +- servers/slapd/overlays/rwmdn.c | 12 +- servers/slapd/overlays/rwmmap.c | 8 +- servers/slapd/overlays/seqmod.c | 2 +- servers/slapd/overlays/syncprov.c | 2 +- servers/slapd/passwd.c | 2 +- servers/slapd/repl.c | 4 +- servers/slapd/result.c | 2 +- servers/slapd/sasl.c | 4 +- servers/slapd/saslauthz.c | 8 +- servers/slapd/schema.c | 2 +- servers/slapd/schema_check.c | 2 +- servers/slapd/schema_init.c | 12 +- servers/slapd/schema_prep.c | 4 +- servers/slapd/sl_malloc.c | 4 +- servers/slapd/slapi/plugin.c | 6 +- servers/slapd/slapi/slapi_pblock.c | 4 +- servers/slapd/syncrepl.c | 2 +- servers/slapd/zn_malloc.c | 4 +- servers/slurpd/ldap_op.c | 4 +- 90 files changed, 357 insertions(+), 357 deletions(-) diff --git a/libraries/liblber/memory.c b/libraries/liblber/memory.c index 904630fd30..c1eeecaa5a 100644 --- a/libraries/liblber/memory.c +++ b/libraries/liblber/memory.c @@ -155,7 +155,7 @@ ber_memfree_x( void *p, void *ctx ) return; } - assert( ber_int_memory_fns->bmf_free ); + assert( ber_int_memory_fns->bmf_free != 0 ); (*ber_int_memory_fns->bmf_free)( p, ctx ); } diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index df4ee9ed58..13baa9a280 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -1206,7 +1206,7 @@ int ldap_pvt_sasl_mutex_lock(void *mutex) return SASL_OK; } #else /* !LDAP_DEBUG_R_SASL */ - assert( mutex ); + assert( mutex != NULL ); #endif /* !LDAP_DEBUG_R_SASL */ return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; @@ -1219,7 +1219,7 @@ int ldap_pvt_sasl_mutex_unlock(void *mutex) return SASL_OK; } #else /* !LDAP_DEBUG_R_SASL */ - assert( mutex ); + assert( mutex != NULL ); #endif /* !LDAP_DEBUG_R_SASL */ return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; @@ -1232,7 +1232,7 @@ void ldap_pvt_sasl_mutex_dispose(void *mutex) return; } #else /* !LDAP_DEBUG_R_SASL */ - assert( mutex ); + assert( mutex != NULL ); #endif /* !LDAP_DEBUG_R_SASL */ (void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex ); LDAP_FREE( mutex ); diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index befab53b3b..3cb13f70e7 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -179,7 +179,7 @@ ldap_perror( LDAP *ld, LDAP_CONST char *str ) assert( ld != NULL ); assert( LDAP_VALID( ld ) ); - assert( str ); + assert( str != NULL ); e = ldap_int_error( ld->ld_errno ); diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 79c49e0470..9bff47c05b 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -358,7 +358,7 @@ ldap_dn_normalize( LDAP_CONST char *dnin, Debug( LDAP_DEBUG_TRACE, "ldap_dn_normalize\n", 0, 0, 0 ); - assert( dnout ); + assert( dnout != NULL ); *dnout = NULL; @@ -563,8 +563,8 @@ ldapava_new( const struct berval *attr, const struct berval *val, { LDAPAVA *ava; - assert( attr ); - assert( val ); + assert( attr != NULL ); + assert( val != NULL ); ava = LDAP_MALLOCX( sizeof( LDAPAVA ) + attr->bv_len + 1, ctx ); @@ -586,7 +586,7 @@ ldapava_new( const struct berval *attr, const struct berval *val, void ldapava_free( LDAPAVA *ava, void *ctx ) { - assert( ava ); + assert( ava != NULL ); #if 0 /* ava's private must be freed by caller @@ -673,7 +673,7 @@ ldap_str2dn( LDAP_CONST char *str, LDAPDN *dn, unsigned flags ) { struct berval bv; - assert( str ); + assert( str != NULL ); bv.bv_len = strlen( str ); bv.bv_val = (char *) str; @@ -700,9 +700,9 @@ ldap_bv2dn_x( struct berval *bvin, LDAPDN *dn, unsigned flags, void *ctx ) char *str, *end; struct berval bvtmp, *bv = &bvtmp; - assert( bvin ); - assert( bvin->bv_val ); - assert( dn ); + assert( bvin != NULL ); + assert( bvin->bv_val != NULL ); + assert( dn != NULL ); *bv = *bvin; str = bv->bv_val; @@ -911,7 +911,7 @@ ldap_str2rdn( LDAP_CONST char *str, LDAPRDN *rdn, { struct berval bv; - assert( str ); + assert( str != NULL ); assert( str[ 0 ] != '\0' ); /* FIXME: is this required? */ bv.bv_len = strlen( str ); @@ -949,11 +949,11 @@ ldap_bv2rdn_x( struct berval *bv, LDAPRDN *rdn, char *str; ber_len_t stoplen; - assert( bv ); - assert( bv->bv_len ); - assert( bv->bv_val ); + assert( bv != NULL ); + assert( bv->bv_len != 0 ); + assert( bv->bv_val != NULL ); assert( rdn || flags & LDAP_DN_SKIP ); - assert( n ); + assert( n != NULL ); str = bv->bv_val; stoplen = bv->bv_len; @@ -1435,9 +1435,9 @@ str2strval( const char *str, ber_len_t stoplen, struct berval *val, const char * const char *p, *end, *startPos, *endPos = NULL; ber_len_t len, escapes; - assert( str ); - assert( val ); - assert( next ); + assert( str != NULL ); + assert( val != NULL ); + assert( next != NULL ); *next = NULL; end = str + stoplen; @@ -1581,9 +1581,9 @@ DCE2strval( const char *str, struct berval *val, const char **next, unsigned fla const char *p, *startPos, *endPos = NULL; ber_len_t len, escapes; - assert( str ); - assert( val ); - assert( next ); + assert( str != NULL ); + assert( val != NULL ); + assert( next != NULL ); *next = NULL; @@ -1666,9 +1666,9 @@ IA52strval( const char *str, struct berval *val, const char **next, unsigned fla const char *p, *startPos, *endPos = NULL; ber_len_t len, escapes; - assert( str ); - assert( val ); - assert( next ); + assert( str != NULL ); + assert( val != NULL ); + assert( next != NULL ); *next = NULL; @@ -1742,9 +1742,9 @@ quotedIA52strval( const char *str, struct berval *val, const char **next, unsign ber_len_t len; unsigned escapes = 0; - assert( str ); - assert( val ); - assert( next ); + assert( str != NULL ); + assert( val != NULL ); + assert( next != NULL ); *next = NULL; @@ -1832,8 +1832,8 @@ hexstr2bin( const char *str, char *c ) { char c1, c2; - assert( str ); - assert( c ); + assert( str != NULL ); + assert( c != NULL ); c1 = str[ 0 ]; c2 = str[ 1 ]; @@ -1874,9 +1874,9 @@ hexstr2binval( const char *str, struct berval *val, const char **next, unsigned ber_len_t len; ber_len_t s, d; - assert( str ); - assert( val ); - assert( next ); + assert( str != NULL ); + assert( val != NULL ); + assert( next != NULL ); *next = NULL; @@ -1976,8 +1976,8 @@ byte2hexpair( const char *val, char *pair ) { static const char hexdig[] = "0123456789ABCDEF"; - assert( val ); - assert( pair ); + assert( val != NULL ); + assert( pair != NULL ); /* * we assume the string has enough room for the hex encoding @@ -1998,8 +1998,8 @@ binval2hexstr( struct berval *val, char *str ) { ber_len_t s, d; - assert( val ); - assert( str ); + assert( val != NULL ); + assert( str != NULL ); if ( val->bv_len == 0 ) { return( 0 ); @@ -2031,8 +2031,8 @@ strval2strlen( struct berval *val, unsigned flags, ber_len_t *len ) int escaped_ascii_len = LDAP_DN_IS_PRETTY( flags ) ? 2 : 3; #endif /* PRETTY_ESCAPE */ - assert( val ); - assert( len ); + assert( val != NULL ); + assert( len != NULL ); *len = 0; if ( val->bv_len == 0 ) { @@ -2109,9 +2109,9 @@ strval2str( struct berval *val, char *str, unsigned flags, ber_len_t *len ) { ber_len_t s, d, end; - assert( val ); - assert( str ); - assert( len ); + assert( val != NULL ); + assert( str != NULL ); + assert( len != NULL ); if ( val->bv_len == 0 ) { *len = 0; @@ -2208,8 +2208,8 @@ strval2IA5strlen( struct berval *val, unsigned flags, ber_len_t *len ) ber_len_t l; char *p; - assert( val ); - assert( len ); + assert( val != NULL ); + assert( len != NULL ); *len = 0; if ( val->bv_len == 0 ) { @@ -2250,9 +2250,9 @@ strval2IA5str( struct berval *val, char *str, unsigned flags, ber_len_t *len ) { ber_len_t s, d, end; - assert( val ); - assert( str ); - assert( len ); + assert( val != NULL ); + assert( str != NULL ); + assert( len != NULL ); if ( val->bv_len == 0 ) { *len = 0; @@ -2298,8 +2298,8 @@ strval2DCEstrlen( struct berval *val, unsigned flags, ber_len_t *len ) ber_len_t l; char *p; - assert( val ); - assert( len ); + assert( val != NULL ); + assert( len != NULL ); *len = 0; if ( val->bv_len == 0 ) { @@ -2338,9 +2338,9 @@ strval2DCEstr( struct berval *val, char *str, unsigned flags, ber_len_t *len ) { ber_len_t s, d; - assert( val ); - assert( str ); - assert( len ); + assert( val != NULL ); + assert( str != NULL ); + assert( len != NULL ); if ( val->bv_len == 0 ) { *len = 0; @@ -2384,8 +2384,8 @@ strval2ADstrlen( struct berval *val, unsigned flags, ber_len_t *len ) ber_len_t l; char *p; - assert( val ); - assert( len ); + assert( val != NULL ); + assert( len != NULL ); *len = 0; if ( val->bv_len == 0 ) { @@ -2424,9 +2424,9 @@ strval2ADstr( struct berval *val, char *str, unsigned flags, ber_len_t *len ) { ber_len_t s, d; - assert( val ); - assert( str ); - assert( len ); + assert( val != NULL ); + assert( str != NULL ); + assert( len != NULL ); if ( val->bv_len == 0 ) { *len = 0; @@ -2477,9 +2477,9 @@ dn2domain( LDAPDN dn, struct berval *bv, int pos, int *iRDN ) /* we are guaranteed there's enough memory in str */ /* sanity */ - assert( dn ); - assert( bv ); - assert( iRDN ); + assert( dn != NULL ); + assert( bv != NULL ); + assert( iRDN != NULL ); assert( *iRDN >= 0 ); str = bv->bv_val + pos; @@ -2488,10 +2488,10 @@ dn2domain( LDAPDN dn, struct berval *bv, int pos, int *iRDN ) LDAPRDN rdn; LDAPAVA *ava; - assert( dn[ i ] ); + assert( dn[ i ] != NULL ); rdn = dn[ i ]; - assert( rdn[ 0 ] ); + assert( rdn[ 0 ] != NULL ); ava = rdn[ 0 ]; if ( !LDAP_DN_IS_RDN_DC( rdn ) ) { @@ -2678,8 +2678,8 @@ rdn2UFNstrlen( LDAPRDN rdn, unsigned flags, ber_len_t *len ) int iAVA; ber_len_t l = 0; - assert( rdn ); - assert( len ); + assert( rdn != NULL ); + assert( len != NULL ); *len = 0; @@ -2757,8 +2757,8 @@ rdn2ADstrlen( LDAPRDN rdn, unsigned flags, ber_len_t *len ) int iAVA; ber_len_t l = 0; - assert( rdn ); - assert( len ); + assert( rdn != NULL ); + assert( len != NULL ); *len = 0; @@ -2838,7 +2838,7 @@ ldap_rdn2str( LDAPRDN rdn, char **str, unsigned flags ) struct berval bv; int rc; - assert( str ); + assert( str != NULL ); if((flags & LDAP_DN_FORMAT_MASK) == LDAP_DN_FORMAT_LBER) { return LDAP_PARAM_ERROR; @@ -2861,7 +2861,7 @@ ldap_rdn2bv_x( LDAPRDN rdn, struct berval *bv, unsigned flags, void *ctx ) int rc, back; ber_len_t l; - assert( bv ); + assert( bv != NULL ); bv->bv_len = 0; bv->bv_val = NULL; @@ -2971,7 +2971,7 @@ int ldap_dn2str( LDAPDN dn, char **str, unsigned flags ) struct berval bv; int rc; - assert( str ); + assert( str != NULL ); if((flags & LDAP_DN_FORMAT_MASK) == LDAP_DN_FORMAT_LBER) { return LDAP_PARAM_ERROR; @@ -2997,7 +2997,7 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx ) int ( *sv2l ) ( struct berval *v, unsigned f, ber_len_t *l ); int ( *sv2s ) ( struct berval *v, char *s, unsigned f, ber_len_t *l ); - assert( bv ); + assert( bv != NULL ); bv->bv_len = 0; bv->bv_val = NULL; @@ -3356,7 +3356,7 @@ ldap_X509dn2bv( void *x509_name, struct berval *bv, LDAPDN_rewrite_func *func, struct berval Val; - assert( bv ); + assert( bv != NULL ); bv->bv_len = 0; bv->bv_val = NULL; diff --git a/libraries/libldap/ppolicy.c b/libraries/libldap/ppolicy.c index bf427d4b39..0092cd8fcf 100644 --- a/libraries/libldap/ppolicy.c +++ b/libraries/libldap/ppolicy.c @@ -138,7 +138,7 @@ ldap_parse_passwordpolicy_control( assert( ld != NULL ); assert( LDAP_VALID( ld ) ); - assert( ctrl ); + assert( ctrl != NULL ); /* Create a BerElement from the berval returned in the control. */ ber = ber_init(&ctrl->ldctl_value); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index e4a18a1a75..ca2c41dab6 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -187,8 +187,8 @@ chkResponseList( tmp = lm; } } else { - assert(lm->lm_chain_tail); - assert(lm->lm_chain_tail->lm_chain); + assert(lm->lm_chain_tail != NULL); + assert(lm->lm_chain_tail->lm_chain != NULL); if ((lm->lm_chain_tail->lm_chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY) || (lm->lm_chain_tail->lm_chain->lm_msgtype @@ -222,7 +222,7 @@ chkResponseList( if ( all == LDAP_MSG_ONE && lm->lm_chain != NULL ) { lm->lm_chain->lm_next = lm->lm_next; lm->lm_chain->lm_chain_tail = ( lm->lm_chain_tail != lm ) ? lm->lm_chain_tail : lm->lm_chain; - assert(lm->lm_chain->lm_chain_tail); + assert(lm->lm_chain->lm_chain_tail != NULL); lm->lm_chain = NULL; lm->lm_chain_tail = NULL; } @@ -868,8 +868,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); assert(l->lm_chain_tail == l); l->lm_chain = newmsg; } else { - assert(l->lm_chain_tail); - assert(l->lm_chain_tail->lm_chain); + assert(l->lm_chain_tail != NULL); + assert(l->lm_chain_tail->lm_chain != NULL); if ((l->lm_chain_tail->lm_chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY) || (l->lm_chain_tail->lm_chain->lm_msgtype diff --git a/libraries/libldap/string.c b/libraries/libldap/string.c index 60c228914b..a3ea27a8f2 100644 --- a/libraries/libldap/string.c +++ b/libraries/libldap/string.c @@ -126,7 +126,7 @@ ldap_pvt_str2upperbv( char *str, struct berval *bv ) { char *s = NULL; - assert( bv ); + assert( bv != NULL ); /* to upper */ if ( str ) { @@ -161,7 +161,7 @@ ldap_pvt_str2lowerbv( char *str, struct berval *bv ) { char *s = NULL; - assert( bv ); + assert( bv != NULL ); /* to lower */ if ( str ) { diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index b6a669fce9..2c1be570f6 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -53,7 +53,7 @@ static const char* skip_url_prefix LDAP_P(( int ldap_pvt_url_scheme2proto( const char *scheme ) { - assert( scheme ); + assert( scheme != NULL ); if( scheme == NULL ) { return -1; @@ -81,7 +81,7 @@ int ldap_pvt_url_scheme2proto( const char *scheme ) int ldap_pvt_url_scheme_port( const char *scheme, int port ) { - assert( scheme ); + assert( scheme != NULL ); if( port ) return port; if( scheme == NULL ) return port; @@ -110,7 +110,7 @@ int ldap_pvt_url_scheme_port( const char *scheme, int port ) int ldap_pvt_url_scheme2tls( const char *scheme ) { - assert( scheme ); + assert( scheme != NULL ); if( scheme == NULL ) { return -1; @@ -804,7 +804,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) return LDAP_URL_ERR_BADSCHEME; } - assert( scheme ); + assert( scheme != NULL ); /* make working copy of the remainder of the URL */ url = LDAP_STRDUP( url_tmp ); diff --git a/libraries/liblutil/ldif.c b/libraries/liblutil/ldif.c index f29d4c3084..69a2c28b6a 100644 --- a/libraries/liblutil/ldif.c +++ b/libraries/liblutil/ldif.c @@ -389,9 +389,9 @@ ldif_must_b64_encode_register( LDAP_CONST char *name, LDAP_CONST char *oid ) int i; ber_len_t len; - assert( must_b64_encode ); - assert( name ); - assert( oid ); + assert( must_b64_encode != NULL ); + assert( name != NULL ); + assert( oid != NULL ); len = strlen( name ); @@ -444,7 +444,7 @@ ldif_must_b64_encode_release( void ) { int i; - assert( must_b64_encode ); + assert( must_b64_encode != NULL ); if ( must_b64_encode == default_must_b64_encode ) { return; @@ -470,8 +470,8 @@ ldif_must_b64_encode( LDAP_CONST char *s ) int i; struct berval bv; - assert( must_b64_encode ); - assert( s ); + assert( must_b64_encode != NULL ); + assert( s != NULL ); ber_str2bv( s, 0, 0, &bv ); diff --git a/libraries/librewrite/context.c b/libraries/librewrite/context.c index 5f4c19d6f2..c5770de892 100644 --- a/libraries/librewrite/context.c +++ b/libraries/librewrite/context.c @@ -433,7 +433,7 @@ rewrite_context_free( { struct rewrite_context *context = (struct rewrite_context *)tmp; - assert( tmp ); + assert( tmp != NULL ); rewrite_context_destroy( &context ); } @@ -446,12 +446,12 @@ rewrite_context_destroy( struct rewrite_context *context; struct rewrite_rule *r; - assert( pcontext ); - assert( *pcontext ); + assert( pcontext != NULL ); + assert( *pcontext != NULL ); context = *pcontext; - assert( context->lc_rule ); + assert( context->lc_rule != NULL ); for ( r = context->lc_rule->lr_next; r; ) { struct rewrite_rule *cr = r; @@ -463,7 +463,7 @@ rewrite_context_destroy( free( context->lc_rule ); context->lc_rule = NULL; - assert( context->lc_name ); + assert( context->lc_name != NULL ); free( context->lc_name ); context->lc_name = NULL; diff --git a/libraries/librewrite/ldapmap.c b/libraries/librewrite/ldapmap.c index 186fd601dc..1cb8f9cd0a 100644 --- a/libraries/librewrite/ldapmap.c +++ b/libraries/librewrite/ldapmap.c @@ -339,8 +339,8 @@ map_ldap_destroy( { struct ldap_map_data *data; - assert( pmap ); - assert( *pmap ); + assert( pmap != NULL ); + assert( *pmap != NULL ); data = ( struct ldap_map_data * )(*pmap)->lb_private; diff --git a/libraries/librewrite/map.c b/libraries/librewrite/map.c index fe06eb14ac..8d72ac35bd 100644 --- a/libraries/librewrite/map.c +++ b/libraries/librewrite/map.c @@ -438,7 +438,7 @@ rewrite_builtin_map_free( { struct rewrite_builtin_map *map = ( struct rewrite_builtin_map * )tmp; - assert( map ); + assert( map != NULL ); switch ( map->lb_type ) { case REWRITE_BUILTIN_MAP_LDAP: @@ -461,8 +461,8 @@ rewrite_map_destroy( { struct rewrite_map *map; - assert( pmap ); - assert( *pmap ); + assert( pmap != NULL ); + assert( *pmap != NULL ); map = *pmap; diff --git a/libraries/librewrite/rule.c b/libraries/librewrite/rule.c index 6a9e43c372..b3fba216e9 100644 --- a/libraries/librewrite/rule.c +++ b/libraries/librewrite/rule.c @@ -72,8 +72,8 @@ destroy_action( { struct rewrite_action *action; - assert( paction ); - assert( *paction ); + assert( paction != NULL ); + assert( *paction != NULL ); action = *paction; @@ -462,8 +462,8 @@ rewrite_rule_destroy( struct rewrite_rule *rule; struct rewrite_action *action; - assert( prule ); - assert( *prule ); + assert( prule != NULL ); + assert( *prule != NULL ); rule = *prule; diff --git a/libraries/librewrite/session.c b/libraries/librewrite/session.c index 18e21a5fe1..ac9196cec8 100644 --- a/libraries/librewrite/session.c +++ b/libraries/librewrite/session.c @@ -177,7 +177,7 @@ rewrite_session_return( struct rewrite_session *session ) { - assert( session ); + assert( session != NULL ); ldap_pvt_thread_mutex_unlock( &session->ls_mutex ); } diff --git a/libraries/librewrite/subst.c b/libraries/librewrite/subst.c index 5ab89cd7f6..83ac4c6e1a 100644 --- a/libraries/librewrite/subst.c +++ b/libraries/librewrite/subst.c @@ -453,8 +453,8 @@ rewrite_subst_destroy( int n; struct rewrite_subst *subst; - assert( psubst ); - assert( *psubst ); + assert( psubst != NULL ); + assert( *psubst != NULL ); subst = *psubst; diff --git a/libraries/librewrite/xmap.c b/libraries/librewrite/xmap.c index ca6e6819be..bc36edd044 100644 --- a/libraries/librewrite/xmap.c +++ b/libraries/librewrite/xmap.c @@ -437,8 +437,8 @@ rewrite_xmap_destroy( { struct rewrite_map *map; - assert( pmap ); - assert( *pmap ); + assert( pmap != NULL ); + assert( *pmap != NULL ); map = *pmap; diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 40de548d29..2f30762b64 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -166,7 +166,7 @@ slap_access_always_allowed( AccessControlState *state, slap_mask_t *maskp ) { - assert( maskp ); + assert( maskp != NULL ); ACL_PRIV_SET( *maskp, ACL_ACCESS2PRIV( access ) ); @@ -3208,7 +3208,7 @@ dynacl_aci_unparse( void *priv, struct berval *bv ) AttributeDescription *ad = ( AttributeDescription * )priv; char *ptr; - assert( ad ); + assert( ad != NULL ); bv->bv_val = ch_malloc( STRLENOF(" aci=") + ad->ad_cname.bv_len + 1 ); ptr = lutil_strcopy( bv->bv_val, " aci=" ); diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 4902043bc4..423a6d38e1 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -228,7 +228,7 @@ at_destroy( void ) int at_start( AttributeType **at ) { - assert( at ); + assert( at != NULL ); *at = LDAP_STAILQ_FIRST(&attr_list); @@ -238,7 +238,7 @@ at_start( AttributeType **at ) int at_next( AttributeType **at ) { - assert( at ); + assert( at != NULL ); #if 1 /* pedantic check */ { @@ -250,7 +250,7 @@ at_next( AttributeType **at ) } } - assert( tmp ); + assert( tmp != NULL ); } #endif diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 7042d18c2b..d0738ed01a 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -126,7 +126,7 @@ attr_dup( Attribute *a ) BER_BVZERO( &tmp->a_vals[i] ); /* a_nvals must be non null; it may be equal to a_vals */ - assert( a->a_nvals ); + assert( a->a_nvals != NULL ); if ( a->a_nvals != a->a_vals ) { tmp->a_nvals = ch_malloc( (i + 1) * sizeof(struct berval) ); diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 5ef52a46c3..c898b7466c 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1063,7 +1063,7 @@ bdb_cache_delete( EntryInfo *ei = BEI(e); int rc; - assert( e->e_private ); + assert( e->e_private != NULL ); /* Set this early, warn off any queriers */ ei->bei_state |= CACHE_ENTRY_DELETED; diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index e994e28ec1..0e17da25b7 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -170,7 +170,7 @@ static int indexer( DB *db; struct berval *keys; - assert( mask ); + assert( mask != 0 ); rc = bdb_db_cache( op->o_bd, atname->bv_val, &db ); diff --git a/servers/slapd/back-bdb/operational.c b/servers/slapd/back-bdb/operational.c index 671a67dfff..5716f475af 100644 --- a/servers/slapd/back-bdb/operational.c +++ b/servers/slapd/back-bdb/operational.c @@ -36,7 +36,7 @@ bdb_hasSubordinates( { int rc; - assert( e ); + assert( e != NULL ); /* NOTE: this should never happen, but it actually happens * when using back-relay; until we find a better way to @@ -89,7 +89,7 @@ bdb_operational( { Attribute **ap; - assert( rs->sr_entry ); + assert( rs->sr_entry != NULL ); for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) /* just count */ ; @@ -102,7 +102,7 @@ bdb_operational( rc = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates ); if ( rc == LDAP_SUCCESS ) { *ap = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE ); - assert( *ap ); + assert( *ap != NULL ); ap = &(*ap)->a_next; } diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index ebb8901d74..180f479803 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -954,7 +954,7 @@ static int oc_filter( { int rc = 0; - assert( f ); + assert( f != NULL ); if( cur > *max ) *max = cur; diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index c64176b963..c64bd149ab 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -327,8 +327,8 @@ ID bdb_tool_entry_put( assert( be != NULL ); assert( slapMode & SLAP_TOOL_MODE ); - assert( text ); - assert( text->bv_val ); + assert( text != NULL ); + assert( text->bv_val != NULL ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(bdb_tool_entry_put) @@ -524,8 +524,8 @@ ID bdb_tool_entry_modify( assert( be != NULL ); assert( slapMode & SLAP_TOOL_MODE ); - assert( text ); - assert( text->bv_val ); + assert( text != NULL ); + assert( text->bv_val != NULL ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ assert ( e->e_id != NOID ); diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 9834bd1fe0..23b5984f6e 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -1280,7 +1280,7 @@ ldap_back_proxy_authz_ctrl_free( Operation *op, LDAPControl ***pctrls ) * added by back-ldap, so it's the only one we explicitly * free */ if ( ctrls && ctrls != op->o_ctrls ) { - assert( ctrls[ 0 ] ); + assert( ctrls[ 0 ] != NULL ); if ( !BER_BVISNULL( &ctrls[ 0 ]->ldctl_value ) ) { free( ctrls[ 0 ]->ldctl_value.bv_val ); diff --git a/servers/slapd/back-ldap/chain.c b/servers/slapd/back-ldap/chain.c index 8b79f2ac50..42ef4d923a 100644 --- a/servers/slapd/back-ldap/chain.c +++ b/servers/slapd/back-ldap/chain.c @@ -132,8 +132,8 @@ chaining_control_remove( * added by the chain overlay, so it's the only one we explicitly * free */ if ( op->o_ctrls != oldctrls ) { - assert( op->o_ctrls ); - assert( op->o_ctrls[ 0 ] ); + assert( op->o_ctrls != NULL ); + assert( op->o_ctrls[ 0 ] != NULL ); free( op->o_ctrls ); diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 307e2dbfd6..3a21f56c9e 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -459,7 +459,7 @@ ldap_build_entry( int last; /* safe assumptions ... */ - assert( ent ); + assert( ent != NULL ); BER_BVZERO( &ent->e_bv ); if ( ber_scanf( &ber, "{m{", bdn ) == LBER_ERROR ) { diff --git a/servers/slapd/back-ldbm/alias.c b/servers/slapd/back-ldbm/alias.c index e31a33b6cb..ae2c11bdf4 100644 --- a/servers/slapd/back-ldbm/alias.c +++ b/servers/slapd/back-ldbm/alias.c @@ -228,7 +228,7 @@ static int dnlist_subordinate( BerVarray dnlist, struct berval *dn ) { - assert( dnlist ); + assert( dnlist != NULL ); for( ; dnlist->bv_val != NULL; dnlist++ ) { if( dnIsSuffix( dnlist, dn ) ) { diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index 4cc80c455b..e98cfdce80 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -75,8 +75,8 @@ cache_entry_private_init( Entry*e ) void cache_entry_commit( Entry *e ) { - assert( e ); - assert( e->e_private ); + assert( e != NULL ); + assert( e->e_private != NULL ); assert( LEI(e)->lei_state == CACHE_ENTRY_CREATING ); /* assert( LEI(e)->lei_refcnt == 1 ); */ @@ -86,7 +86,7 @@ cache_entry_commit( Entry *e ) static int cache_entry_private_destroy( Entry*e ) { - assert( e->e_private ); + assert( e->e_private != NULL ); free( e->e_private ); e->e_private = NULL; @@ -106,7 +106,7 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); - assert( e->e_private ); + assert( e->e_private != NULL ); id = e->e_id; refcnt = --LEI(e)->lei_refcnt; @@ -326,7 +326,7 @@ cache_update_entry( /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); - assert( e->e_private ); + assert( e->e_private != NULL ); if ( avl_insert( &cache->c_dntree, (caddr_t) e, entry_dn_cmp, avl_dup_error ) != 0 ) @@ -437,7 +437,7 @@ try_again: * we do not need to lock the entry if we only * check the state, refcnt, LRU, and id. */ - assert( ep->e_private ); + assert( ep->e_private != NULL ); /* save id */ id = ep->e_id; @@ -509,7 +509,7 @@ try_again: count++; - assert( ep->e_private ); + assert( ep->e_private != NULL ); ep_id = ep->e_id; state = LEI(ep)->lei_state; @@ -575,7 +575,7 @@ cache_delete_entry( /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); - assert( e->e_private ); + assert( e->e_private != NULL ); Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n", e->e_id, 0, 0 ); diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index ae9489a519..c3022e3b19 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -122,7 +122,7 @@ dn2id( Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn->bv_val, 0, 0 ); - assert( idp ); + assert( idp != NULL ); /* first check the cache */ *idp = cache_find_entry_ndn2id( be, &li->li_cache, dn ); diff --git a/servers/slapd/back-ldbm/operational.c b/servers/slapd/back-ldbm/operational.c index b62c84bada..890870f89a 100644 --- a/servers/slapd/back-ldbm/operational.c +++ b/servers/slapd/back-ldbm/operational.c @@ -55,7 +55,7 @@ ldbm_back_operational( { Attribute **ap; - assert( rs->sr_entry ); + assert( rs->sr_entry != NULL ); for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) /* just count */ ; @@ -67,7 +67,7 @@ ldbm_back_operational( hs = has_children( op->o_bd, rs->sr_entry ); *ap = slap_operational_hasSubordinate( hs ); - assert( *ap ); + assert( *ap != NULL ); ap = &(*ap)->a_next; } diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index 4fffb1f9d5..945bc2ecea 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -183,8 +183,8 @@ ID ldbm_tool_entry_put( assert( slapMode & SLAP_TOOL_MODE ); assert( id2entry != NULL ); - assert( text ); - assert( text->bv_val ); + assert( text != NULL ); + assert( text->bv_val != NULL ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ if ( next_id_get( be, &id ) || id == NOID ) { diff --git a/servers/slapd/back-meta/dncache.c b/servers/slapd/back-meta/dncache.c index cfe5a80c5f..ccaf446de6 100644 --- a/servers/slapd/back-meta/dncache.c +++ b/servers/slapd/back-meta/dncache.c @@ -97,8 +97,8 @@ meta_dncache_get_target( time_t curr_time; int target = META_TARGET_NONE; - assert( cache ); - assert( ndn ); + assert( cache != NULL ); + assert( ndn != NULL ); tmp_entry.dn = *ndn; ldap_pvt_thread_mutex_lock( &cache->mutex ); @@ -149,8 +149,8 @@ meta_dncache_update_entry( time_t curr_time = 0L; int err = 0; - assert( cache ); - assert( ndn ); + assert( cache != NULL ); + assert( ndn != NULL ); /* * if cache->ttl < 0, cache never expires; @@ -209,8 +209,8 @@ meta_dncache_delete_entry( metadncacheentry_t *entry, tmp_entry; - assert( cache ); - assert( ndn ); + assert( cache != NULL ); + assert( ndn != NULL ); tmp_entry.dn = *ndn; diff --git a/servers/slapd/back-meta/map.c b/servers/slapd/back-meta/map.c index 87ca4b9031..550c06ad13 100644 --- a/servers/slapd/back-meta/map.c +++ b/servers/slapd/back-meta/map.c @@ -87,7 +87,7 @@ ldap_back_map_init ( struct ldapmap *lm, struct ldapmapping **m ) { struct ldapmapping *mapping; - assert( m ); + assert( m != NULL ); *m = NULL; @@ -116,7 +116,7 @@ ldap_back_mapping ( struct ldapmap *map, struct berval *s, struct ldapmapping ** Avlnode *tree; struct ldapmapping fmapping; - assert( m ); + assert( m != NULL ); if ( remap == BACKLDAP_REMAP ) { tree = map->remap; @@ -601,8 +601,8 @@ ldap_back_referral_result_rewrite( { int i, last; - assert( dc ); - assert( a_vals ); + assert( dc != NULL ); + assert( a_vals != NULL ); for ( last = 0; !BER_BVISNULL( &a_vals[ last ] ); last++ ) ; diff --git a/servers/slapd/back-meta/suffixmassage.c b/servers/slapd/back-meta/suffixmassage.c index 244e4666eb..da96c8be2d 100644 --- a/servers/slapd/back-meta/suffixmassage.c +++ b/servers/slapd/back-meta/suffixmassage.c @@ -126,7 +126,7 @@ ldap_back_dn_massage( int i, src, dst; struct berval pretty = {0,NULL}, *dn = odn; - assert( res ); + assert( res != NULL ); if ( dn == NULL ) { res->bv_val = NULL; diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index e41afb2aa2..caa59c7a95 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -183,8 +183,8 @@ monitor_subsys_conn_update( current_bv = BER_BVC( "cn=current" ); struct berval rdn; - assert( mi ); - assert( e ); + assert( mi != NULL ); + assert( e != NULL ); dnRdn( &e->e_nname, &rdn ); diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index f6d5d94a80..69df414617 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -280,7 +280,7 @@ monitor_subsys_database_init( break; } } - assert( on2 ); + assert( on2 != NULL ); snprintf( buf, sizeof( buf ), "cn=Overlay %d,%s", @@ -429,7 +429,7 @@ monitor_subsys_database_init( break; } } - assert( on2 ); + assert( on2 != NULL ); snprintf( buf, sizeof( buf ), "dn: cn=Overlay %d,cn=Database %d,%s\n" diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index df6a08a990..055af96c0a 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -216,7 +216,7 @@ monitor_back_register_subsys( /* FIXME: this should only be possible * if be_monitor is already initialized */ - assert( be_monitor ); + assert( be_monitor != NULL ); if ( ms->mss_open && ( *ms->mss_open )( be_monitor, ms ) ) { return -1; @@ -1387,7 +1387,7 @@ monitor_back_db_open( #endif static char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; - assert( be_monitor ); + assert( be_monitor != NULL ); if ( be != be_monitor ) { be_monitor = be; } @@ -1590,7 +1590,7 @@ monitor_back_db_open( ep = &mp->mp_next; } - assert( be ); + assert( be != NULL ); be->be_private = mi; diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index a5ac6cf8a5..8b8cac4530 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -168,8 +168,8 @@ monitor_subsys_ops_update( Attribute *a; static struct berval bv_ops = BER_BVC( "cn=operations" ); - assert( mi ); - assert( e ); + assert( mi != NULL ); + assert( e != NULL ); dnRdn( &e->e_nname, &rdn ); diff --git a/servers/slapd/back-monitor/operational.c b/servers/slapd/back-monitor/operational.c index 2437b5f230..b59399f650 100644 --- a/servers/slapd/back-monitor/operational.c +++ b/servers/slapd/back-monitor/operational.c @@ -41,7 +41,7 @@ monitor_back_operational( { Attribute **ap; - assert( rs->sr_entry ); + assert( rs->sr_entry != NULL ); for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) /* just count */ ; @@ -54,11 +54,11 @@ monitor_back_operational( mp = ( monitor_entry_t * )rs->sr_entry->e_private; - assert( mp ); + assert( mp != NULL ); hs = MONITOR_HAS_CHILDREN( mp ); *ap = slap_operational_hasSubordinate( hs ); - assert( *ap ); + assert( *ap != NULL ); ap = &(*ap)->a_next; } diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index b8f82ab049..8f6f50ce40 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -206,7 +206,7 @@ monitor_subsys_rww_update( snprintf( buf, sizeof( buf ), "%ld", num ); a = attr_find( e->e_attrs, mi->mi_ad_monitorCounter ); - assert( a ); + assert( a != NULL ); len = strlen( buf ); if ( len > a->a_vals[ 0 ].bv_len ) { a->a_vals[ 0 ].bv_val = ber_memrealloc( a->a_vals[ 0 ].bv_val, len + 1 ); diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index 6600ee6ae1..f4909e3b18 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -156,8 +156,8 @@ monitor_subsys_sent_update( Attribute *a; int i; - assert( mi ); - assert( e ); + assert( mi != NULL ); + assert( e != NULL ); dnRdn( &e->e_nname, &nrdn ); @@ -195,7 +195,7 @@ monitor_subsys_sent_update( ldap_pvt_thread_mutex_unlock(&slap_counters.sc_sent_mutex); a = attr_find( e->e_attrs, mi->mi_ad_monitorCounter ); - assert( a ); + assert( a != NULL ); /* NOTE: no minus sign is allowed in the counters... */ UI2BV( &a->a_vals[ 0 ], n ); diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index 685365c9eb..02037979b5 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -176,8 +176,8 @@ monitor_subsys_time_update( static struct berval bv_current = BER_BVC( "cn=current" ); struct berval rdn; - assert( mi ); - assert( e ); + assert( mi != NULL ); + assert( e != NULL ); dnRdn( &e->e_nname, &rdn ); diff --git a/servers/slapd/back-relay/init.c b/servers/slapd/back-relay/init.c index d3b19e6d49..b458740d7f 100644 --- a/servers/slapd/back-relay/init.c +++ b/servers/slapd/back-relay/init.c @@ -100,7 +100,7 @@ relay_back_db_open( Backend *be ) ri->ri_bd = select_backend( &ri->ri_realsuffix, 0, 1 ); /* must be there: it was during config! */ - assert( ri->ri_bd ); + assert( ri->ri_bd != NULL ); /* inherit controls */ AC_MEMCPY( be->be_ctrls, ri->ri_bd->be_ctrls, sizeof( be->be_ctrls ) ); diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 0a5e44561c..19a15021ab 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -66,7 +66,7 @@ backsql_modify_delete_all_values( SQLHSTMT asth = SQL_NULL_HSTMT; BACKSQL_ROW_NTS row; - assert( at ); + assert( at != NULL ); if ( at->bam_delete_proc == NULL ) { Debug( LDAP_DEBUG_TRACE, " backsql_modify_delete_all_values(): " diff --git a/servers/slapd/back-sql/api.c b/servers/slapd/back-sql/api.c index e4584c3ebf..d1f983b058 100644 --- a/servers/slapd/back-sql/api.c +++ b/servers/slapd/back-sql/api.c @@ -35,8 +35,8 @@ backsql_api_config( backsql_info *bi, const char *name, int argc, char *argv[] ) { backsql_api *ba; - assert( bi ); - assert( name ); + assert( bi != NULL ); + assert( name != NULL ); for ( ba = backsqlapi; ba; ba = ba->ba_next ) { if ( strcasecmp( name, ba->ba_name ) == 0 ) { @@ -66,7 +66,7 @@ backsql_api_destroy( backsql_info *bi ) { backsql_api *ba; - assert( bi ); + assert( bi != NULL ); ba = bi->sql_api; @@ -88,7 +88,7 @@ backsql_api_register( backsql_api *ba ) { backsql_api *ba2; - assert( ba ); + assert( ba != NULL ); assert( ba->ba_private == NULL ); if ( ba->ba_name == NULL ) { diff --git a/servers/slapd/back-sql/config.c b/servers/slapd/back-sql/config.c index aa66ac02b7..062c0367ca 100644 --- a/servers/slapd/back-sql/config.c +++ b/servers/slapd/back-sql/config.c @@ -53,7 +53,7 @@ backsql_db_config( backsql_info *bi = (backsql_info *)be->be_private; Debug( LDAP_DEBUG_TRACE, "==>backsql_db_config()\n", 0, 0, 0 ); - assert( bi ); + assert( bi != NULL ); if ( !strcasecmp( argv[ 0 ], "dbhost" ) ) { if ( argc < 2 ) { @@ -649,7 +649,7 @@ read_baseObject( int rc = 0, lineno = 0, lmax = 0; char *buf = NULL; - assert( fname ); + assert( fname != NULL ); fp = ldif_open( fname, "r" ); if ( fp == NULL ) { @@ -788,7 +788,7 @@ create_baseObject( struct berval bv = BER_BVNULL; const char *text = NULL; - assert( ava ); + assert( ava != NULL ); rc = slap_bv2ad( &ava->la_attr, &ad, &text ); if ( rc != LDAP_SUCCESS ) { diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c index 21fd448758..35f793cde2 100644 --- a/servers/slapd/back-sql/entry-id.c +++ b/servers/slapd/back-sql/entry-id.c @@ -39,7 +39,7 @@ backsql_free_entryID( Operation *op, backsql_entryID *id, int freeit ) { backsql_entryID *next; - assert( id ); + assert( id != NULL ); next = id->eid_next; @@ -154,7 +154,7 @@ backsql_dn2id( /* begin TimesTen */ Debug( LDAP_DEBUG_TRACE, " backsql_dn2id(\"%s\"): id_query \"%s\"\n", ndn->bv_val, bi->sql_id_query, 0 ); - assert( bi->sql_id_query ); + assert( bi->sql_id_query != NULL ); rc = backsql_Prepare( dbh, &sth, bi->sql_id_query, 0 ); if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, @@ -367,7 +367,7 @@ backsql_count_children( /* begin TimesTen */ Debug(LDAP_DEBUG_TRACE, "children id query \"%s\"\n", bi->sql_has_children_query, 0, 0); - assert( bi->sql_has_children_query ); + assert( bi->sql_has_children_query != NULL ); rc = backsql_Prepare( dbh, &sth, bi->sql_has_children_query, 0 ); if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, @@ -470,8 +470,8 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) slap_syntax_transform_func *pretty = NULL; #endif /* BACKSQL_PRETTY_VALIDATE */ - assert( at ); - assert( bsi ); + assert( at != NULL ); + assert( bsi != NULL ); #ifdef BACKSQL_ARBITRARY_KEY Debug( LDAP_DEBUG_TRACE, "==>backsql_get_attr_vals(): " @@ -836,7 +836,7 @@ backsql_id2entry( backsql_srch_info *bsi, backsql_entryID *eid ) Debug( LDAP_DEBUG_TRACE, "==>backsql_id2entry()\n", 0, 0, 0 ); - assert( bsi->bsi_e ); + assert( bsi->bsi_e != NULL ); memset( bsi->bsi_e, 0, sizeof( Entry ) ); diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index 90906ce294..f5502eb237 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -247,10 +247,10 @@ backsql_db_open( /* normalize filter values only if necessary */ bi->sql_caseIgnoreMatch = mr_find( "caseIgnoreMatch" ); - assert( bi->sql_caseIgnoreMatch ); + assert( bi->sql_caseIgnoreMatch != NULL ); bi->sql_telephoneNumberMatch = mr_find( "telephoneNumberMatch" ); - assert( bi->sql_telephoneNumberMatch ); + assert( bi->sql_telephoneNumberMatch != NULL ); if ( bi->sql_dbuser == NULL ) { Debug( LDAP_DEBUG_TRACE, "backsql_db_open(): " diff --git a/servers/slapd/back-sql/operational.c b/servers/slapd/back-sql/operational.c index e0f4af3b1a..bb8eac5535 100644 --- a/servers/slapd/back-sql/operational.c +++ b/servers/slapd/back-sql/operational.c @@ -84,7 +84,7 @@ backsql_operational_entryCSN( Operation *op ) #ifdef BACKSQL_SYNCPROV if ( op->o_sync && op->o_tag == LDAP_REQ_SEARCH ) { - assert( op->o_private ); + assert( op->o_private != NULL ); entryCSN = *((struct berval *)op->o_private); @@ -164,7 +164,7 @@ backsql_operational( case LDAP_COMPARE_TRUE: case LDAP_COMPARE_FALSE: *ap = slap_operational_hasSubordinate( rc == LDAP_COMPARE_TRUE ); - assert( *ap ); + assert( *ap != NULL ); ap = &(*ap)->a_next; rc = 0; break; diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c index 44698952f5..3b9c8f8fab 100644 --- a/servers/slapd/back-sql/schema-map.c +++ b/servers/slapd/back-sql/schema-map.c @@ -800,9 +800,9 @@ backsql_supad2at( backsql_oc_map_rec *objclass, AttributeDescription *supad, struct supad2at_t va = { 0 }; int rc; - assert( objclass ); - assert( supad ); - assert( pret ); + assert( objclass != NULL ); + assert( supad != NULL ); + assert( pret != NULL ); *pret = NULL; diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index aa08445385..96f5c3a814 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -272,7 +272,7 @@ backsql_init_search( int getentry = BACKSQL_IS_GET_ENTRY( flags ); int gotit = 0; - assert( op->o_bd->be_private ); + assert( op->o_bd->be_private != NULL ); rc = backsql_dn2id( op, rs, dbh, nbase, &bsi->bsi_base_id, matched, 1 ); @@ -1250,7 +1250,7 @@ backsql_srch_query( backsql_srch_info *bsi, struct berval *query ) backsql_info *bi = (backsql_info *)bsi->bsi_op->o_bd->be_private; int rc; - assert( query ); + assert( query != NULL ); BER_BVZERO( query ); bsi->bsi_use_subtree_shortcut = 0; @@ -1344,7 +1344,7 @@ backsql_srch_query( backsql_srch_info *bsi, struct berval *query ) int i; BackendDB *bd = bsi->bsi_op->o_bd; - assert( bd->be_nsuffix ); + assert( bd->be_nsuffix != NULL ); for ( i = 0; !BER_BVISNULL( &bd->be_nsuffix[ i ] ); i++ ) { diff --git a/servers/slapd/back-sql/sql-wrap.c b/servers/slapd/back-sql/sql-wrap.c index 61beb4f14a..e97bb06095 100644 --- a/servers/slapd/back-sql/sql-wrap.c +++ b/servers/slapd/back-sql/sql-wrap.c @@ -322,7 +322,7 @@ backsql_open_db_conn( backsql_info *bi, unsigned long ldap_cid, backsql_db_conn backsql_db_conn *dbc; int rc; - assert( pdbc ); + assert( pdbc != NULL ); *pdbc = NULL; Debug( LDAP_DEBUG_TRACE, "==>backsql_open_db_conn()\n", 0, 0, 0 ); @@ -435,7 +435,7 @@ backsql_get_db_conn( Operation *op, SQLHDBC *dbh ) Debug( LDAP_DEBUG_TRACE, "==>backsql_get_db_conn()\n", 0, 0, 0 ); - assert( dbh ); + assert( dbh != NULL ); *dbh = SQL_NULL_HDBC; tmp.ldap_cid = op->o_connid; diff --git a/servers/slapd/back-sql/util.c b/servers/slapd/back-sql/util.c index c90823b73e..4bb276f0f2 100644 --- a/servers/slapd/back-sql/util.c +++ b/servers/slapd/back-sql/util.c @@ -71,7 +71,7 @@ backsql_strcat( struct berbuf *dest, ... ) ber_len_t cdlen, cslen, grow; char *cstr; - assert( dest ); + assert( dest != NULL ); assert( dest->bb_val.bv_val == NULL || dest->bb_val.bv_len == strlen( dest->bb_val.bv_val ) ); @@ -138,8 +138,8 @@ backsql_strfcat( struct berbuf *dest, const char *fmt, ... ) va_list strs; ber_len_t cdlen; - assert( dest ); - assert( fmt ); + assert( dest != NULL ); + assert( fmt != NULL ); assert( dest->bb_len == 0 || dest->bb_len > dest->bb_val.bv_len ); assert( dest->bb_val.bv_val == NULL || dest->bb_val.bv_len == strlen( dest->bb_val.bv_val ) ); @@ -225,7 +225,7 @@ backsql_strfcat( struct berbuf *dest, const char *fmt, ... ) #endif /* BACKSQL_TRACE */ } - assert( cstr ); + assert( cstr != NULL ); AC_MEMCPY( dest->bb_val.bv_val + cdlen, cstr, cslen + 1 ); cdlen += cslen; @@ -280,8 +280,8 @@ backsql_get_table_spec( backsql_info *bi, char **p ) char *s, *q; struct berbuf res = BB_NULL; - assert( p ); - assert( *p ); + assert( p != NULL ); + assert( *p != NULL ); s = *p; while ( **p && **p != ',' ) { @@ -397,8 +397,8 @@ backsql_split_pattern( #define SPLIT_CHAR '?' - assert( _pattern ); - assert( split_pattern ); + assert( _pattern != NULL ); + assert( split_pattern != NULL ); pattern = ch_strdup( _pattern ); @@ -457,7 +457,7 @@ backsql_prepare_pattern( int i; struct berbuf bb = BB_NULL; - assert( res ); + assert( res != NULL ); for ( i = 0; values[i].bv_val; i++ ) { if ( split_pattern[i].bv_val == NULL ) { @@ -496,9 +496,9 @@ backsql_entryUUID( /* entryUUID is generated as "%08x-%04x-%04x-0000-eaddrXXX" * with eid_oc_id as %08x and hi and lo eid_id as %04x-%04x */ - assert( bi ); - assert( id ); - assert( entryUUID ); + assert( bi != NULL ); + assert( id != NULL ); + assert( entryUUID != NULL ); #ifdef BACKSQL_ARBITRARY_KEY snprintf( uuidbuf, sizeof( uuidbuf ), diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index ed795dbf32..950c2f55be 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -99,7 +99,7 @@ int backend_init(void) } for( bi=slap_binfo; bi->bi_type != NULL; bi++,nBackendInfo++ ) { - assert( bi->bi_init ); + assert( bi->bi_init != 0 ); rc = bi->bi_init( bi ); @@ -202,7 +202,7 @@ int backend_startup_one(Backend *be) { int rc = 0; - assert( be ); + assert( be != NULL ); be->be_pending_csn_list = (struct be_pcl *) ch_calloc( 1, sizeof( struct be_pcl )); @@ -1613,9 +1613,9 @@ backend_access( Backend *be = op->o_bd; /* pedantic */ - assert( op ); - assert( op->o_conn ); - assert( edn ); + assert( op != NULL ); + assert( op->o_conn != NULL ); + assert( edn != NULL ); assert( access > ACL_NONE ); op->o_bd = select_backend( edn, 0, 0 ); diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 6294d0c636..6f8bd15170 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -600,7 +600,7 @@ overlay_find( const char *over_type ) { slap_overinst *on = overlays; - assert( over_type ); + assert( over_type != NULL ); for ( ; on; on = on->on_next ) { if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) { @@ -635,7 +635,7 @@ overlay_is_inst( BackendDB *be, const char *over_type ) { slap_overinst *on; - assert( be ); + assert( be != NULL ); if ( !overlay_is_over( be ) ) { return 0; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 5bf7b3992e..013c1a76b8 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -865,7 +865,7 @@ int bindconf_parse( const char *word, slap_bindconf *bc ) { break; case 'd': - assert( tab->aux ); + assert( tab->aux != NULL ); iptr = (int *)((char *)bc + tab->off); rc = 1; @@ -918,7 +918,7 @@ int bindconf_unparse( slap_bindconf *bc, struct berval *bv ) { break; case 'd': - assert( tab->aux ); + assert( tab->aux != NULL ); iptr = (int *)((char *)bc + tab->off); for ( i = 0; !BER_BVISNULL( &tab->aux[i].word ); i++ ) { diff --git a/servers/slapd/cr.c b/servers/slapd/cr.c index 0dcf1484a8..107f2dba83 100644 --- a/servers/slapd/cr.c +++ b/servers/slapd/cr.c @@ -127,8 +127,8 @@ cr_insert( cir->cir_name.bv_len = strlen( scr->scr_oid ); cir->cir_cr = scr; - assert( cir->cir_name.bv_val ); - assert( cir->cir_cr ); + assert( cir->cir_name.bv_val != NULL ); + assert( cir->cir_cr != NULL ); if ( avl_insert( &cr_index, (caddr_t) cir, cr_index_cmp, avl_dup_error ) ) @@ -150,8 +150,8 @@ cr_insert( cir->cir_name.bv_len = strlen( *names ); cir->cir_cr = scr; - assert( cir->cir_name.bv_val ); - assert( cir->cir_cr ); + assert( cir->cir_name.bv_val != NULL ); + assert( cir->cir_cr != NULL ); if ( avl_insert( &cr_index, (caddr_t) cir, cr_index_cmp, avl_dup_error ) ) diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 161de6edb5..726ca5b596 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -558,9 +558,9 @@ static int get_url_perms( { int i; - assert( exts ); - assert( perms ); - assert( crit ); + assert( exts != NULL ); + assert( perms != NULL ); + assert( crit != NULL ); *crit = 0; for ( i = 0; exts[ i ]; i++ ) { diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 5da22ac6a4..24bc185ff5 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -59,14 +59,14 @@ LDAPRDN_validate( LDAPRDN rdn ) int iAVA; int rc; - assert( rdn ); + assert( rdn != NULL ); for ( iAVA = 0; rdn[ iAVA ]; iAVA++ ) { LDAPAVA *ava = rdn[ iAVA ]; AttributeDescription *ad; slap_syntax_validate_func *validate = NULL; - assert( ava ); + assert( ava != NULL ); if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) { const char *text = NULL; @@ -112,20 +112,20 @@ LDAPDN_validate( LDAPDN dn ) int iRDN; int rc; - assert( dn ); + assert( dn != NULL ); for ( iRDN = 0; dn[ iRDN ]; iRDN++ ) { LDAPRDN rdn = dn[ iRDN ]; int iAVA; - assert( rdn ); + assert( rdn != NULL ); for ( iAVA = 0; rdn[ iAVA ]; iAVA++ ) { LDAPAVA *ava = rdn[ iAVA ]; AttributeDescription *ad; slap_syntax_validate_func *validate = NULL; - assert( ava ); + assert( ava != NULL ); if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) { const char *text = NULL; @@ -173,7 +173,7 @@ dnValidate( int rc; LDAPDN dn = NULL; - assert( in ); + assert( in != NULL ); if ( in->bv_len == 0 ) { return LDAP_SUCCESS; @@ -211,7 +211,7 @@ rdnValidate( LDAPRDN rdn; char* p; - assert( in ); + assert( in != NULL ); if ( in->bv_len == 0 ) { return LDAP_SUCCESS; @@ -261,14 +261,14 @@ AVA_Sort( LDAPRDN rdn, int iAVA ) int i; LDAPAVA *ava_in = rdn[ iAVA ]; - assert( rdn ); - assert( ava_in ); + assert( rdn != NULL ); + assert( ava_in != NULL ); for ( i = 0; i < iAVA; i++ ) { LDAPAVA *ava = rdn[ i ]; int a, j; - assert( ava ); + assert( ava != NULL ); a = strcmp( ava_in->la_attr.bv_val, ava->la_attr.bv_val ); @@ -337,7 +337,7 @@ LDAPRDN_rewrite( LDAPRDN rdn, unsigned flags, void *ctx ) struct berval bv = BER_BVNULL; int do_sort = 0; - assert( ava ); + assert( ava != NULL ); if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) { const char *text = NULL; @@ -444,13 +444,13 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx ) int iRDN; int rc; - assert( dn ); + assert( dn != NULL ); for ( iRDN = 0; dn[ iRDN ]; iRDN++ ) { LDAPRDN rdn = dn[ iRDN ]; int iAVA; - assert( rdn ); + assert( rdn != NULL ); for ( iAVA = 0; rdn[ iAVA ]; iAVA++ ) { LDAPAVA *ava = rdn[ iAVA ]; @@ -462,7 +462,7 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx ) struct berval bv = BER_BVNULL; int do_sort = 0; - assert( ava ); + assert( ava != NULL ); if ( ( ad = AVA_PRIVATE( ava ) ) == NULL ) { const char *text = NULL; @@ -570,8 +570,8 @@ dnNormalize( struct berval *out, void *ctx) { - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> dnNormalize: <%s>\n", val->bv_val, 0, 0 ); @@ -626,8 +626,8 @@ rdnNormalize( struct berval *out, void *ctx) { - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> dnNormalize: <%s>\n", val->bv_val, 0, 0 ); if ( val->bv_len != 0 ) { @@ -682,8 +682,8 @@ dnPretty( struct berval *out, void *ctx) { - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); @@ -739,8 +739,8 @@ rdnPretty( struct berval *out, void *ctx) { - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); @@ -800,8 +800,8 @@ dnPrettyNormalDN( int flags, void *ctx ) { - assert( val ); - assert( dn ); + assert( val != NULL ); + assert( dn != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> dn%sDN: <%s>\n", flags == SLAP_LDAPDN_PRETTY ? "Pretty" : "Normal", @@ -854,9 +854,9 @@ dnPrettyNormal( { Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 ); - assert( val ); - assert( pretty ); - assert( normal ); + assert( val != NULL ); + assert( pretty != NULL ); + assert( normal != NULL ); if ( val->bv_len == 0 ) { ber_dupbv_x( pretty, val, ctx ); @@ -940,9 +940,9 @@ dnMatch( int match; struct berval *asserted = (struct berval *) assertedValue; - assert( matchp ); - assert( value ); - assert( assertedValue ); + assert( matchp != NULL ); + assert( value != NULL ); + assert( assertedValue != NULL ); assert( !BER_BVISNULL( value ) ); assert( !BER_BVISNULL( asserted ) ); @@ -975,9 +975,9 @@ dnRelativeMatch( int match; struct berval *asserted = (struct berval *) assertedValue; - assert( matchp ); - assert( value ); - assert( assertedValue ); + assert( matchp != NULL ); + assert( value != NULL ); + assert( assertedValue != NULL ); assert( !BER_BVISNULL( value ) ); assert( !BER_BVISNULL( asserted ) ); @@ -1074,9 +1074,9 @@ rdnMatch( int match; struct berval *asserted = (struct berval *) assertedValue; - assert( matchp ); - assert( value ); - assert( assertedValue ); + assert( matchp != NULL ); + assert( value != NULL ); + assert( assertedValue != NULL ); match = value->bv_len - asserted->bv_len; @@ -1165,8 +1165,8 @@ dnExtractRdn( const char *p; int rc; - assert( dn ); - assert( rdn ); + assert( dn != NULL ); + assert( rdn != NULL ); if( dn->bv_len == 0 ) { return LDAP_OTHER; @@ -1194,7 +1194,7 @@ dn_rdnlen( { const char *p; - assert( dn_in ); + assert( dn_in != NULL ); if ( dn_in == NULL ) { return 0; @@ -1319,8 +1319,8 @@ dnIsSuffix( { int d = dn->bv_len - suffix->bv_len; - assert( dn ); - assert( suffix ); + assert( dn != NULL ); + assert( suffix != NULL ); /* empty suffix matches any dn */ if ( suffix->bv_len == 0 ) { diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 0d7527c0eb..8ea1ad2ff0 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -779,8 +779,8 @@ filter_escape_value_x( void *ctx ) { ber_len_t i; - assert( in ); - assert( out ); + assert( in != NULL ); + assert( out != NULL ); i = in->bv_len * 3 + 1; out->bv_val = ctx ? slap_sl_malloc( i, ctx ) : ch_malloc( i ); diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index b201fd469d..34b8bc784f 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -444,7 +444,7 @@ static int test_mra_filter( int ret; const char *text; - assert( ad ); + assert( ad != NULL ); if ( mra->ma_desc ) { /* have a mra type? check for subtype */ @@ -588,7 +588,7 @@ test_ava_filter( } mr = slap_schema.si_ad_entryDN->ad_type->sat_equality; - assert( mr ); + assert( mr != NULL ); rc = value_match( &match, slap_schema.si_ad_entryDN, mr, SLAP_MR_EXT, &e->e_nname, &ava->aa_value, &text ); diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index 2c4106e79a..eaa60ecb8b 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -72,8 +72,8 @@ limits_get( { struct slap_limits **lm; - assert( op ); - assert( limit ); + assert( op != NULL ); + assert( limit != NULL ); Debug( LDAP_DEBUG_TRACE, "==> limits_get: %s dn=\"%s\"\n", op->o_log_prefix, @@ -238,8 +238,8 @@ limits_add( struct slap_limits *lm; unsigned type, style; - assert( be ); - assert( limit ); + assert( be != NULL ); + assert( limit != NULL ); type = flags & SLAP_LIMITS_TYPE_MASK; style = flags & SLAP_LIMITS_MASK; @@ -304,8 +304,8 @@ limits_add( switch ( type ) { case SLAP_LIMITS_TYPE_GROUP: - assert( group_oc ); - assert( group_ad ); + assert( group_oc != NULL ); + assert( group_ad != NULL ); lm->lm_group_oc = group_oc; lm->lm_group_ad = group_ad; break; @@ -342,7 +342,7 @@ limits_parse( ObjectClass *group_oc = NULL; AttributeDescription *group_ad = NULL; - assert( be ); + assert( be != NULL ); if ( argc < 3 ) { Debug( LDAP_DEBUG_ANY, @@ -637,8 +637,8 @@ limits_parse_one( struct slap_limits_set *limit ) { - assert( arg ); - assert( limit ); + assert( arg != NULL ); + assert( limit != NULL ); if ( strncasecmp( arg, "time", STRLENOF( "time" ) ) == 0 ) { arg += STRLENOF( "time" ); @@ -1075,8 +1075,8 @@ t_hard: int limits_check( Operation *op, SlapReply *rs ) { - assert( op ); - assert( rs ); + assert( op != NULL ); + assert( rs != NULL ); /* FIXME: should this be always true? */ assert( op->o_tag == LDAP_REQ_SEARCH); diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index cbe3c1b241..b7d7589105 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -910,13 +910,13 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], &tmpval ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mod->sml_nvalues[0], &tmpval ); mod->sml_nvalues[1].bv_len = 0; mod->sml_nvalues[1].bv_val = NULL; - assert( mod->sml_nvalues[0].bv_val ); + assert( mod->sml_nvalues[0].bv_val != NULL ); *modtail = mod; modtail = &mod->sml_next; } @@ -937,7 +937,7 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], &tmpval ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); (*mod->sml_desc->ad_type->sat_equality->smr_normalize)( @@ -960,13 +960,13 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], &name ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mod->sml_nvalues[0], &nname ); mod->sml_nvalues[1].bv_len = 0; mod->sml_nvalues[1].bv_val = NULL; - assert( mod->sml_nvalues[0].bv_val ); + assert( mod->sml_nvalues[0].bv_val != NULL ); *modtail = mod; modtail = &mod->sml_next; @@ -980,7 +980,7 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], ×tamp ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = NULL; *modtail = mod; modtail = &mod->sml_next; @@ -997,7 +997,7 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], &csn ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = NULL; *modtail = mod; modtail = &mod->sml_next; @@ -1011,13 +1011,13 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], &name ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mod->sml_nvalues[0], &nname ); mod->sml_nvalues[1].bv_len = 0; mod->sml_nvalues[1].bv_val = NULL; - assert( mod->sml_nvalues[0].bv_val ); + assert( mod->sml_nvalues[0].bv_val != NULL ); *modtail = mod; modtail = &mod->sml_next; @@ -1030,7 +1030,7 @@ int slap_mods_opattrs( ber_dupbv( &mod->sml_values[0], ×tamp ); mod->sml_values[1].bv_len = 0; mod->sml_values[1].bv_val = NULL; - assert( mod->sml_values[0].bv_val ); + assert( mod->sml_values[0].bv_val != NULL ); mod->sml_nvalues = NULL; *modtail = mod; modtail = &mod->sml_next; diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 3ba189856a..7ebba1b3e6 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -90,7 +90,7 @@ modify_add_values( for ( p = i = 0; !BER_BVISNULL( &mod->sm_values[i] ); i++ ) { int match; - assert( a->a_vals[0].bv_val ); + assert( a->a_vals[0].bv_val != NULL ); for ( j = 0; !BER_BVISNULL( &a->a_vals[j] ); j++ ) { if ( mod->sm_nvalues ) { rc = ordered_value_match( &match, mod->sm_desc, mr, @@ -245,7 +245,7 @@ modify_delete_vindex( } if( mod->sm_nvalues ) { - assert( a->a_nvals ); + assert( a->a_nvals != NULL ); rc = ordered_value_match( &match, a->a_desc, mr, SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 33a7421d34..360abe126a 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -462,8 +462,8 @@ oc_insert( oir->oir_name.bv_len = strlen( soc->soc_oid ); oir->oir_oc = soc; - assert( oir->oir_name.bv_val ); - assert( oir->oir_oc ); + assert( oir->oir_name.bv_val != NULL ); + assert( oir->oir_oc != NULL ); if ( avl_insert( &oc_index, (caddr_t) oir, oc_index_cmp, avl_dup_error ) ) @@ -493,8 +493,8 @@ oc_insert( oir->oir_name.bv_len = strlen( *names ); oir->oir_oc = soc; - assert( oir->oir_name.bv_val ); - assert( oir->oir_oc ); + assert( oir->oir_name.bv_val != NULL ); + assert( oir->oir_oc != NULL ); if ( avl_insert( &oc_index, (caddr_t) oir, oc_index_cmp, avl_dup_error ) ) diff --git a/servers/slapd/operational.c b/servers/slapd/operational.c index 9aec4402b3..cbc149421c 100644 --- a/servers/slapd/operational.c +++ b/servers/slapd/operational.c @@ -53,7 +53,7 @@ slap_operational_entryDN( Entry *e ) { Attribute *a; - assert( e ); + assert( e != NULL ); assert( !BER_BVISNULL( &e->e_name ) ); assert( !BER_BVISNULL( &e->e_nname ) ); diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 3615ab16df..a92a180d56 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -87,8 +87,8 @@ dynlist_make_filter( Operation *op, struct berval *oldf, struct berval *newf ) char *ptr; - assert( oldf ); - assert( newf ); + assert( oldf != NULL ); + assert( newf != NULL ); assert( !BER_BVISNULL( oldf ) ); assert( !BER_BVISEMPTY( oldf ) ); diff --git a/servers/slapd/overlays/glue.c b/servers/slapd/overlays/glue.c index f9fa7bd46a..569bb80786 100644 --- a/servers/slapd/overlays/glue.c +++ b/servers/slapd/overlays/glue.c @@ -69,7 +69,7 @@ glue_back_select ( int i; for (i = 0; igi_nodes; i++) { - assert( gi->gi_n[i].gn_be->be_nsuffix ); + assert( gi->gi_n[i].gn_be->be_nsuffix != NULL ); if (dnIsSuffix(dn, &gi->gi_n[i].gn_be->be_nsuffix[0])) { return gi->gi_n[i].gn_be; @@ -338,8 +338,8 @@ glue_op_search ( Operation *op, SlapReply *rs ) } op->o_bd = btmp; - assert( op->o_bd->be_suffix ); - assert( op->o_bd->be_nsuffix ); + assert( op->o_bd->be_suffix != NULL ); + assert( op->o_bd->be_nsuffix != NULL ); if (scope0 == LDAP_SCOPE_ONELEVEL && dn_match(pdn, &ndn)) diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 7393f150a4..bbb208161a 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -212,7 +212,7 @@ account_locked( Operation *op, Entry *e, { Attribute *la; - assert(mod); + assert(mod != NULL); if ( (la = attr_find( e->e_attrs, ad_pwdAccountLockedTime )) != NULL ) { BerVarray vals = la->a_nvals; @@ -1449,7 +1449,7 @@ do_modify: ber_dupbv( &mods->sml_values[0], ×tamp ); mods->sml_values[1].bv_len = 0; mods->sml_values[1].bv_val = NULL; - assert( mods->sml_values[0].bv_val ); + assert( mods->sml_values[0].bv_val != NULL ); } else { mods->sml_op = LDAP_MOD_DELETE; mods->sml_values = NULL; diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 3da26b2686..b458383231 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -207,7 +207,7 @@ rwm_op_add( Operation *op, SlapReply *rs ) } if ( mapping != NULL ) { - assert( mapping->m_dst_ad ); + assert( mapping->m_dst_ad != NULL ); (*ap)->a_desc = mapping->m_dst_ad; } } @@ -344,7 +344,7 @@ rwm_op_compare( Operation *op, SlapReply *rs ) } } else { - assert( mapping->m_dst_ad ); + assert( mapping->m_dst_ad != NULL ); ad = mapping->m_dst_ad; } @@ -524,7 +524,7 @@ rwm_op_modify( Operation *op, SlapReply *rs ) next_mod:; if ( mapping != NULL ) { /* use new attribute description */ - assert( mapping->m_dst_ad ); + assert( mapping->m_dst_ad != NULL ); (*mlp)->sml_desc = mapping->m_dst_ad; } @@ -972,7 +972,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first, int stripEntryDN ) if ( mapping != NULL ) { /* rewrite the attribute description */ - assert( mapping->m_dst_ad ); + assert( mapping->m_dst_ad != NULL ); (*ap)->a_desc = mapping->m_dst_ad; } @@ -1004,7 +1004,7 @@ rwm_send_entry( Operation *op, SlapReply *rs ) dncookie dc; int rc; - assert( rs->sr_entry ); + assert( rs->sr_entry != NULL ); /* * Rewrite the dn of the result, if needed diff --git a/servers/slapd/overlays/rwmdn.c b/servers/slapd/overlays/rwmdn.c index 8b26b9818a..5cdf0522ee 100644 --- a/servers/slapd/overlays/rwmdn.c +++ b/servers/slapd/overlays/rwmdn.c @@ -159,9 +159,9 @@ rwm_dn_massage( struct berval mdn; static char *dmy = ""; - assert( dc ); - assert( in ); - assert( dn ); + assert( dc != NULL ); + assert( in != NULL ); + assert( dn != NULL ); rc = rewrite_session( dc->rwmap->rwm_rw, dc->ctx, ( in->bv_val ? in->bv_val : dmy ), @@ -221,9 +221,9 @@ rwm_dn_massage( int i, src, dst; struct berval tmpin; - assert( dc ); - assert( in ); - assert( dn ); + assert( dc != NULL ); + assert( in != NULL ); + assert( dn != NULL ); BER_BVZERO( dn ); diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index c201744ae0..3b33525565 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -71,7 +71,7 @@ rwm_map_init( struct ldapmap *lm, struct ldapmapping **m ) const char *text; int rc; - assert( m ); + assert( m != NULL ); *m = NULL; @@ -110,7 +110,7 @@ rwm_mapping( struct ldapmap *map, struct berval *s, struct ldapmapping **m, int Avlnode *tree; struct ldapmapping fmapping; - assert( m ); + assert( m != NULL ); if ( remap == RWM_REMAP ) { tree = map->remap; @@ -163,7 +163,7 @@ rwm_map_attrnames( { int i, j; - assert( anp ); + assert( anp != NULL ); *anp = NULL; @@ -791,7 +791,7 @@ rwm_referral_rewrite( struct berval dn = BER_BVNULL, ndn = BER_BVNULL; - assert( a_vals ); + assert( a_vals != NULL ); /* * Rewrite the dn if needed diff --git a/servers/slapd/overlays/seqmod.c b/servers/slapd/overlays/seqmod.c index be2efda0f1..18f5ded5d7 100644 --- a/servers/slapd/overlays/seqmod.c +++ b/servers/slapd/overlays/seqmod.c @@ -61,7 +61,7 @@ seqmod_op_cleanup( Operation *op, SlapReply *rs ) /* This op is done, remove it */ ldap_pvt_thread_mutex_lock( &sm->sm_mutex ); av = avl_find2( sm->sm_mods, &mtdummy, sm_avl_cmp ); - assert(av); + assert(av != NULL); mt = av->avl_data; diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index ca18cc0ae0..5a075cd1ad 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -1696,7 +1696,7 @@ syncprov_search_response( Operation *op, SlapReply *rs ) * control. */ if ( !rs->sr_entry ) { - assert( rs->sr_entry ); + assert( rs->sr_entry != NULL ); Debug( LDAP_DEBUG_ANY, "bogus referral in context\n",0,0,0 ); return SLAP_CB_CONTINUE; } diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index db44ffe17a..82acabab4a 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -470,7 +470,7 @@ slap_passwd_hash_type( new->bv_len = 0; new->bv_val = NULL; - assert( hash ); + assert( hash != NULL ); lutil_passwd_hash( cred , hash, new, text ); } diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index f6f453997f..cfc2cb3d3b 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -48,8 +48,8 @@ add_replica_info( { int i = 0; - assert( be ); - assert( host ); + assert( be != NULL ); + assert( host != NULL ); if ( be->be_replica != NULL ) { for ( ; be->be_replica[ i ] != NULL; i++ ); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 97c5cf3857..49f62c494d 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -50,7 +50,7 @@ int slap_null_cb( Operation *op, SlapReply *rs ) int slap_freeself_cb( Operation *op, SlapReply *rs ) { - assert( op->o_callback ); + assert( op->o_callback != NULL ); op->o_tmpfree( op->o_callback, op->o_tmpmemctx ); op->o_callback = NULL; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 52701bab78..6051a506eb 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1522,8 +1522,8 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, int rc, is_dn = SET_NONE, do_norm = 1; struct berval dn2, *mech; - assert( conn ); - assert( id ); + assert( conn != NULL ); + assert( id != NULL ); Debug( LDAP_DEBUG_ARGS, "slap_sasl_getdn: conn %lu id=%s [len=%lu]\n", conn->c_connid, diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index bb4abc1822..b1bdf74389 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -131,11 +131,11 @@ int slap_parse_user( struct berval *id, struct berval *user, { char u; - assert( id ); + assert( id != NULL ); assert( !BER_BVISNULL( id ) ); - assert( user ); - assert( realm ); - assert( mech ); + assert( user != NULL ); + assert( realm != NULL ); + assert( mech != NULL ); u = id->bv_val[ 0 ]; diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index c2f0970ff9..7dd42ddf07 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -103,7 +103,7 @@ schema_info( Entry **entry, const char **text ) } nvals[0].bv_val = strchr( frontendDB->be_schemandn.bv_val, '=' ); - assert( nvals[0].bv_val ); + assert( nvals[0].bv_val != NULL ); nvals[0].bv_val++; nvals[0].bv_len = frontendDB->be_schemandn.bv_len - (nvals[0].bv_val - frontendDB->be_schemandn.bv_val); diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 1d47ff4365..02a3f012cd 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -79,7 +79,7 @@ entry_schema_check( const char *type = a->a_desc->ad_cname.bv_val; /* there should be at least one value */ - assert( a->a_vals ); + assert( a->a_vals != NULL ); assert( a->a_vals[0].bv_val != NULL ); if( a->a_desc->ad_type->sat_check ) { diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index b64cd67b21..7b5d1ff435 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -892,8 +892,8 @@ nameUIDPretty( struct berval *out, void *ctx ) { - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> nameUIDPretty: <%s>\n", val->bv_val, 0, 0 ); @@ -2398,8 +2398,8 @@ serialNumberAndIssuerPretty( ber_len_t n; struct berval sn, i, newi; - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerPretty: <%s>\n", val->bv_val, 0, 0 ); @@ -2472,8 +2472,8 @@ serialNumberAndIssuerNormalize( ber_len_t n; struct berval sn, i, newi; - assert( val ); - assert( out ); + assert( val != NULL ); + assert( out != NULL ); Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerNormalize: <%s>\n", val->bv_val, 0, 0 ); diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index f5343ea007..873e22303f 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -297,8 +297,8 @@ static int objectSubClassIndexer( ocvalues[noc] = sup->soc_cname; - assert( ocvalues[noc].bv_val ); - assert( ocvalues[noc].bv_len ); + assert( ocvalues[noc].bv_val != NULL ); + assert( ocvalues[noc].bv_len != 0 ); noc++; diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index adf19ca9c8..e5d78627dd 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -477,7 +477,7 @@ slap_sl_free(void *ptr, void *ctx) Debug(LDAP_DEBUG_TRACE, "slap_sl_free: " "free object not found while bit is clear.\n", 0, 0, 0); - assert(so); + assert(so != NULL); } } else { @@ -527,7 +527,7 @@ slap_sl_free(void *ptr, void *ctx) Debug(LDAP_DEBUG_TRACE, "slap_sl_free: " "free object not found while bit is clear.\n", 0, 0, 0 ); - assert( so ); + assert(so != NULL); } } else { diff --git a/servers/slapd/slapi/plugin.c b/servers/slapd/slapi/plugin.c index 6ebe041408..b10995b220 100644 --- a/servers/slapd/slapi/plugin.c +++ b/servers/slapd/slapi/plugin.c @@ -223,7 +223,7 @@ slapi_int_get_plugins( int numPB = 0; int rc = LDAP_SUCCESS; - assert( ppFuncPtrs ); + assert( ppFuncPtrs != NULL ); /* * First, count the plugins associated with a specific @@ -610,7 +610,7 @@ slapi_int_load_plugin( int rc = LDAP_SUCCESS; SLAPI_FUNC fpInitFunc = NULL; - assert( pLdHandle ); + assert( pLdHandle != NULL ); if ( lt_dlinit() ) { return LDAP_LOCAL_ERROR; @@ -768,7 +768,7 @@ slapi_int_plugin_unparse( ) { Slapi_PBlock *pp; - int i, j, rc; + int i, j; char **argv, ibuf[32], *ptr; struct berval idx, bv; diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index 6dcbe7b536..165c6afafc 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -566,7 +566,7 @@ int slapi_int_pblock_get_first( Backend *be, Slapi_PBlock **pb ) { #if defined(LDAP_SLAPI) - assert( pb ); + assert( pb != NULL ); *pb = (Slapi_PBlock *)be->be_pb; return (*pb == NULL ? LDAP_OTHER : LDAP_SUCCESS); #else /* LDAP_SLAPI */ @@ -581,7 +581,7 @@ int slapi_int_pblock_get_next( Slapi_PBlock **pb ) { #if defined(LDAP_SLAPI) - assert( pb ); + assert( pb != NULL ); return slapi_pblock_get( *pb, SLAPI_IBM_PBLOCK, pb ); #else /* LDAP_SLAPI */ return LDAP_OTHER; diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 6c23bc9cbf..55541c19b7 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1465,7 +1465,7 @@ retry_add:; op->o_tag = LDAP_REQ_MODIFY; - assert( *modlist ); + assert( *modlist != NULL ); /* Delete all the old attrs */ for ( i = 0; i < dni.attrs; i++ ) { diff --git a/servers/slapd/zn_malloc.c b/servers/slapd/zn_malloc.c index ff9a25bf5a..eb2f035de6 100644 --- a/servers/slapd/zn_malloc.c +++ b/servers/slapd/zn_malloc.c @@ -542,7 +542,7 @@ slap_zn_free(void *ptr, void *ctx) Debug(LDAP_DEBUG_ANY, "slap_zn_free: " "free object not found while bit is clear.\n", 0, 0, 0); - assert(zo); + assert(zo != NULL); } } else { @@ -604,7 +604,7 @@ slap_zn_free(void *ptr, void *ctx) Debug(LDAP_DEBUG_ANY, "slap_zn_free: " "free object not found while bit is clear.\n", 0, 0, 0 ); - assert( zo ); + assert(zo != NULL); } } else { diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 16d719867a..77cee77f1b 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -321,7 +321,7 @@ op_ldap_modify( continue; } - assert( ldm ); + assert( ldm != NULL ); /* * We should have an attribute: value pair here. @@ -505,7 +505,7 @@ op_ldap_modrdn( } #endif /* LDAP_DEBUG */ - assert( newrdn ); + assert( newrdn != NULL ); /* Do the modrdn */ rc = ldap_rename2_s( ri->ri_ldp, re->re_dn, newrdn, newsup, drdnflag ); -- 2.39.5