diff options
author | Thomas Rast <trast@student.ethz.ch> | 2012-03-01 22:40:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-03-01 14:34:42 -0800 |
commit | efe4be12490ab684786c48135731c4d2648bbecc (patch) | |
tree | 2b405ed312a3cbdf5f6092223e41feb4775eaed3 /t/t5515/fetch.br-branches-one-octopus_branches-one | |
parent | aa9828561e562a0b9ca559be4225de679b8e8be3 (diff) | |
download | git-efe4be12490ab684786c48135731c4d2648bbecc.tar.gz |
bundle: keep around names passed to add_pending_object()tr/maint-bundle-boundary
The 'name' field passed to add_pending_object() is used to later
deduplicate in object_array_remove_duplicates().
git-bundle had a bug in this area since 18449ab (git-bundle: avoid
packing objects which are in the prerequisites, 2007-03-08): it passed
the name of each boundary object in a static buffer. In other words,
all that object_array_remove_duplicates() saw was the name of the
*last* added boundary object.
The recent switch to a strbuf in bc2fed4 (bundle: use a strbuf to scan
the log for boundary commits, 2012-02-22) made this slightly worse: we
now free the buffer at the end, so it is not even guaranteed that it
still points into addressable memory by the time object_array_remove_
duplicates looks at it. On the plus side however, it was now
detectable by valgrind.
The fix is easy: pass a copy of the string to add_pending_object.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515/fetch.br-branches-one-octopus_branches-one')
0 files changed, 0 insertions, 0 deletions