Merge branch 'jk/list-objects-filter-cleanup'

Fix uninitialized memory access in a recent fix-up that is already
in -rc1.

* jk/list-objects-filter-cleanup:
  list-objects-filter: initialize sub-filter structs
This commit is contained in:
Junio C Hamano 2022-09-22 15:30:47 -07:00
Родитель 1b3d6e17fe 4eaed7c2f2
Коммит 4b79ee4b0c
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -143,6 +143,7 @@ static int parse_combine_subfilter(
ALLOC_GROW_BY(filter_options->sub, filter_options->sub_nr, 1,
filter_options->sub_alloc);
list_objects_filter_init(&filter_options->sub[new_index]);
decoded = url_percent_decode(subspec->buf);
@ -263,6 +264,8 @@ void parse_list_objects_filter(
parse_error = gently_parse_list_objects_filter(
filter_options, arg, &errbuf);
} else {
struct list_objects_filter_options *sub;
/*
* Make filter_options an LOFC_COMBINE spec so we can trivially
* add subspecs to it.
@ -273,10 +276,11 @@ void parse_list_objects_filter(
filter_spec_append_urlencode(filter_options, arg);
ALLOC_GROW_BY(filter_options->sub, filter_options->sub_nr, 1,
filter_options->sub_alloc);
sub = &filter_options->sub[filter_options->sub_nr - 1];
parse_error = gently_parse_list_objects_filter(
&filter_options->sub[filter_options->sub_nr - 1], arg,
&errbuf);
list_objects_filter_init(sub);
parse_error = gently_parse_list_objects_filter(sub, arg,
&errbuf);
}
if (parse_error)
die("%s", errbuf.buf);