From e59d2488588297bb6be77af4323cabfa7cf24729 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 2 Feb 2003 09:22:38 +0000 Subject: [PATCH] Fix crasher in bvptr2obj Fix hasvalue --- servers/slapd/slapi/slapi_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index c52e2bf2a9..01e6031614 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -83,6 +83,8 @@ bvptr2obj( tmpberval[i].bv_val = bvptr[i]->bv_val; tmpberval[i].bv_len = bvptr[i]->bv_len; } + tmpberval[i].bv_val = NULL; + tmpberval[i].bv_len = 0; if ( rc == LDAP_SUCCESS ) { *bvobj = tmpberval; @@ -445,7 +447,7 @@ slapi_entry_attr_hasvalue( Slapi_Entry *e, const char *type, const char *value ) bv.bv_val = (char *)value; bv.bv_len = strlen( value ); - return slapi_attr_value_find( attr, &bv ); + return ( slapi_attr_value_find( attr, &bv ) != -1 ); #else return 0; #endif -- 2.39.5