summaryrefslogtreecommitdiff
path: root/Documentation/git-rev-list.txt
diff options
context:
space:
mode:
authorLibravatar Brandon Casey <drafnel@gmail.com>2011-10-07 22:20:20 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-10 10:05:07 -0700
commit43d20a8c50355f7f68548e91bd8822c3cbfff52f (patch)
treef938cfb2de8b76ead888f04278bb415c8e57f3a4 /Documentation/git-rev-list.txt
parentrefs: Use binary search to lookup refs faster (diff)
downloadtgif-43d20a8c50355f7f68548e91bd8822c3cbfff52f.tar.xz
refs.c: ensure struct whose member may be passed to realloc is initialized
The variable "refs" is allocated on the stack but is not initialized. It is passed to read_packed_refs(), and its struct members may eventually be passed to add_ref() and ALLOC_GROW(). Since the structure has not been initialized, its members may contain random non-zero values. So let's initialize it. The call sequence looks something like this: resolve_gitlink_packed_ref(...) { struct cached_refs refs; ... read_packed_refs(f, &refs); ... } read_packed_refs(FILE*, struct cached_refs *cached_refs) { ... add_ref(name, sha1, flag, &cached_refs->packed, &last); ... } add_ref(..., struct ref_array *refs, struct ref_entry **) { ... ALLOC_GROW(refs->refs, refs->nr + 1, refs->alloc); } Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-rev-list.txt')
0 files changed, 0 insertions, 0 deletions