]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/valsort.c
check for ee == NULL
[openldap] / servers / slapd / overlays / valsort.c
index 5950a208c40b4e09a960901f360fcddbf3ddc2ee..5cc06cfaf0acdbe7d4300c826e438f9f82cbe722 100644 (file)
@@ -304,9 +304,7 @@ valsort_response( Operation *op, SlapReply *rs )
                        a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad );
                }
 
-               /* count values */
-               for ( n = 0; !BER_BVISNULL( &a->a_vals[n] ); n++ );
-
+               n = a->a_numvals;
                if ( vi->vi_sort & VALSORT_WEIGHTED ) {
                        int j, gotnvals;
                        long *index = op->o_tmpalloc( n * sizeof(long), op->o_tmpmemctx );