diff options
author | Jeff King <peff@peff.net> | 2013-03-19 12:17:22 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-20 12:53:26 -0700 |
commit | 57165db00309e756d6d22b097a2fd6cc14055d14 (patch) | |
tree | 71a6762d96c0e4acc0cc2d87e0936e2e5fbf8ac3 /t/t9154 | |
parent | Git 1.7.12.4 (diff) | |
download | tgif-57165db00309e756d6d22b097a2fd6cc14055d14.tar.xz |
index-pack: always zero-initialize object_entry list
Commit 38a4556 (index-pack: start learning to emulate
"verify-pack -v", 2011-06-03) added a "delta_depth" counter
to each "struct object_entry". Initially, all object entries
have their depth set to 0; in resolve_delta, we then set the
depth of each delta to "base + 1". Base entries never have
their depth touched, and remain at 0.
To ensure that all depths start at 0, that commit changed
calls to xmalloc the object_entry list into calls to
xcalloc. However, it forgot that we grow the list with
xrealloc later. These extra entries are used when we add an
object from elsewhere to complete a thin pack. If we add a
non-delta object, its depth value will just be uninitialized
heap data.
This patch fixes it by zero-initializing entries we add to
the objects list via the xrealloc.
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9154')
0 files changed, 0 insertions, 0 deletions