Skip to content

Commit dc12ee7

Browse files
jiangxingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7556e5d commit dc12ee7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

protocol-caps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void send_info(struct repository *r, struct packet_writer *writer,
7777

7878
int cap_object_info(struct repository *r, struct packet_reader *request)
7979
{
80-
struct requested_info info;
80+
struct requested_info info = { 0 };
8181
struct packet_writer writer;
8282
struct string_list oid_str_list = STRING_LIST_INIT_DUP;
8383

0 commit comments

Comments
 (0)