From: Junio C Hamano Date: Fri, 21 Jun 2019 18:24:09 +0000 (-0700) Subject: Merge branch 'md/list-objects-filter-memfix' X-Git-Tag: v2.23.0-rc0~103 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/34032c4f8fe90aa020f7d85c556312b3d8902f6e Merge branch 'md/list-objects-filter-memfix' The filter_data used in the list-objects-filter (which manages a lazily sparse clone repository) did not use the dynamic array API correctly---'nr' is supposed to point at one past the last element of the array in use. This has been corrected. * md/list-objects-filter-memfix: list-objects-filter: correct usage of ALLOC_GROW --- 34032c4f8fe90aa020f7d85c556312b3d8902f6e diff --cc list-objects-filter.c index 53f90442c5,7824a480e1..36e1f774bc --- a/list-objects-filter.c +++ b/list-objects-filter.c @@@ -354,9 -268,9 +354,9 @@@ static enum list_objects_filter_result dtype = DT_DIR; val = is_excluded_from_list(pathname, strlen(pathname), filename, &dtype, &filter_data->el, - &the_index); + r->index); if (val < 0) - val = filter_data->array_frame[filter_data->nr].defval; + val = filter_data->array_frame[filter_data->nr - 1].defval; ALLOC_GROW(filter_data->array_frame, filter_data->nr + 1, filter_data->alloc);