From: Luke Howard Date: Sun, 2 Feb 2003 09:22:38 +0000 (+0000) Subject: Fix crasher in bvptr2obj X-Git-Tag: NO_SLAP_OP_BLOCKS~451 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e59d2488588297bb6be77af4323cabfa7cf24729;p=openldap Fix crasher in bvptr2obj Fix hasvalue --- 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