diff options
author | Michał Kępień <michal@isc.org> | 2020-10-20 08:48:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-20 21:53:26 +0200 |
commit | ec7967cfafd5844e33afbc1e6fb8ba1b9e5b111b (patch) | |
tree | fbe510604f80b470f7ab46871eb1e43e7a1903d9 /xdiff/xhistogram.c | |
parent | Git 2.28 (diff) | |
download | git-ec7967cfafd5844e33afbc1e6fb8ba1b9e5b111b.tar.xz git-ec7967cfafd5844e33afbc1e6fb8ba1b9e5b111b.zip |
merge-base, xdiff: zero out xpparam_t structures
xpparam_t structures are usually zero-initialized before their specific
fields are assigned to, but there are three locations in the tree where
that does not happen. Add the missing memset() calls in order to make
initialization of xpparam_t structures consistent tree-wide and to
prevent stack garbage from being used as field values.
Signed-off-by: Michał Kępień <michal@isc.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff/xhistogram.c')
-rw-r--r-- | xdiff/xhistogram.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index c7b35a9667..e694bfd9e3 100644 --- a/xdiff/xhistogram.c +++ b/xdiff/xhistogram.c @@ -235,6 +235,8 @@ static int fall_back_to_classic_diff(xpparam_t const *xpp, xdfenv_t *env, int line1, int count1, int line2, int count2) { xpparam_t xpparam; + + memset(&xpparam, 0, sizeof(xpparam)); xpparam.flags = xpp->flags & ~XDF_DIFF_ALGORITHM_MASK; return xdl_fall_back_diff(env, &xpparam, |