]> git.sur5r.net Git - openldap/commitdiff
Don't crash if no attributes in slapi_attr_value_find()
authorLuke Howard <lukeh@openldap.org>
Sun, 4 May 2003 16:59:10 +0000 (16:59 +0000)
committerLuke Howard <lukeh@openldap.org>
Sun, 4 May 2003 16:59:10 +0000 (16:59 +0000)
servers/slapd/slapi/slapi_utils.c

index 135b744a4fd3b495346b2fed6da6b3c79fdffbb1..8bb1a8660a6d5b857e8be4e7988e69de82bc0e15 100644 (file)
@@ -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;
 }