From: Luke Howard Date: Sun, 4 May 2003 16:59:10 +0000 (+0000) Subject: Don't crash if no attributes in slapi_attr_value_find() X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~169 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=13f0acfb6a47198502e7d33d3c92d2eff208b713;p=openldap Don't crash if no attributes in slapi_attr_value_find() --- diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 135b744a4f..8bb1a8660a 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -2512,6 +2512,9 @@ int slapi_attr_value_find( const Slapi_Attr *a, struct berval *v ) int rc; int ret; + if ( a ->a_vals == NULL ) { + return -1; + } mr = a->a_desc->ad_type->sat_equality; for ( bv = a->a_vals, j = 0; bv->bv_val != NULL; bv++, j++ ) { rc = value_match( &ret, a->a_desc, mr, @@ -2523,7 +2526,7 @@ int slapi_attr_value_find( const Slapi_Attr *a, struct berval *v ) return 0; } } -#endif +#endif /* LDAP_SLAPI */ return -1; }