refspec: make sure stack refspec_item variables are zeroed
commit95e7c385393488cb20c29697d8655f94ce83c413
authorJacob Keller <jacob.keller@gmail.com>
Sat, 15 Aug 2020 00:25:08 +0000 (14 17:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Aug 2020 17:39:21 +0000 (17 10:39 -0700)
tree2ff928e09a57dc3ddf3f7e4abb30a37cd1de9abb
parent0becfec5b154c37a0cd2d3f7a6a0c908ba7b5c1e
refspec: make sure stack refspec_item variables are zeroed

A couple of functions that used struct refspec_item did not zero out the
structure memory. This can result in unexpected behavior, especially if
additional parameters are ever added to refspec_item in the future. Use
memset to ensure that unset structure members are zero.

It may make sense to convert most of these uses of struct refspec_item
to use either struct initializers or refspec_item_init_or_die. However,
other similar code uses memset. Converting all of these uses has been
left as a future exercise.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
transport.c