From: Junio C Hamano Date: Thu, 25 Jul 2019 21:27:12 +0000 (-0700) Subject: Merge branch 'md/list-objects-filter-memfix' into maint X-Git-Tag: v2.23.0-rc0~6^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43f40de9409111a86d5a8d5c9d3f4b9415a05f8f;p=thirdparty%2Fgit.git Merge branch 'md/list-objects-filter-memfix' into maint 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 --- 43f40de9409111a86d5a8d5c9d3f4b9415a05f8f 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);