From 13f0acfb6a47198502e7d33d3c92d2eff208b713 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 4 May 2003 16:59:10 +0000 Subject: [PATCH] Don't crash if no attributes in slapi_attr_value_find() --- servers/slapd/slapi/slapi_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.39.5