object-info: init request_info before reading arg

When retrieving object info via capability "object-info", we store the
command args into a requested_info variable, but forget to initialize
it. Initialize the variable before use to prevent unexpected output.

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jiang Xin 2023-04-02 21:05:57 +08:00 committed by Junio C Hamano
parent 7556e5d737
commit dc12ee77ab

View File

@ -77,7 +77,7 @@ static void send_info(struct repository *r, struct packet_writer *writer,
int cap_object_info(struct repository *r, struct packet_reader *request)
{
struct requested_info info;
struct requested_info info = { 0 };
struct packet_writer writer;
struct string_list oid_str_list = STRING_LIST_INIT_DUP;