]> git.sur5r.net Git - openldap/commitdiff
Fix crasher in bvptr2obj
authorLuke Howard <lukeh@openldap.org>
Sun, 2 Feb 2003 09:22:38 +0000 (09:22 +0000)
committerLuke Howard <lukeh@openldap.org>
Sun, 2 Feb 2003 09:22:38 +0000 (09:22 +0000)
Fix hasvalue

servers/slapd/slapi/slapi_utils.c

index c52e2bf2a96b9d259fd22792c7d126fe5fcd1edf..01e603161470cb0f433f85583db6b38f52473b63 100644 (file)
@@ -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