summaryrefslogtreecommitdiff
path: root/t/t3502-cherry-pick-merge.sh
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2018-02-27 06:47:04 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-27 14:27:16 -0800
commit21abed500cb06bc54247cbc11def92739259bb70 (patch)
tree7e6f629e892e6011e3039f1877b151c63f155873 /t/t3502-cherry-pick-merge.sh
parentsha1_name: minimize OID comparisons during disambiguation (diff)
downloadtgif-21abed500cb06bc54247cbc11def92739259bb70.tar.xz
sha1_name: fix uninitialized memory errors
During abbreviation checks, we navigate to the position within a pack-index that an OID would be inserted and check surrounding OIDs for the maximum matching prefix. This position may be beyond the last position, because the given OID is lexicographically larger than every OID in the pack. Then nth_packed_object_oid() does not initialize "oid". Use the return value of nth_packed_object_oid() to prevent these errors. Also the comment about checking near-by objects miscounts the neighbours. If we have a hit at "first", we check "first-1" and "first+1" to make sure we have sufficiently long abbreviation not to match either. If we do not have a hit, "first" is the smallest among the objects that are larger than what we want to name, so we check that and "first-1" to make sure we have sufficiently long abbreviation not to match either. In either case, we only check up to two near-by objects. Reported-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3502-cherry-pick-merge.sh')
0 files changed, 0 insertions, 0 deletions