summaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-28 19:46:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-30 21:59:50 (GMT)
commit903fc7da44b091a87c4bc00a892930786c71a709 (patch)
treecb93269a3d5c51e35ae92ec046f91c7e9d672ce7 /builtin/notes.c
parentcddac45219b70f121d30468811a9fbee78fa24f2 (diff)
downloadgit-903fc7da44b091a87c4bc00a892930786c71a709.zip
git-903fc7da44b091a87c4bc00a892930786c71a709.tar.gz
git-903fc7da44b091a87c4bc00a892930786c71a709.tar.bz2
name-rev: replace static buffer with strbuf
When name-rev needs to format an actual name, we do so into a fixed-size buffer. That includes the actual ref tip, as well as any traversal information. Since refs can exceed 1024 bytes, this means you can get a bogus result. E.g., doing: git tag $(perl -e 'print join("/", 1..1024)') git describe --contains HEAD^ results in ".../282/283", when it should be ".../1023/1024~1". We can solve this by using a heap buffer. We'll use a strbuf, which lets us write into the same buffer from our loop without having to reallocate. Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'builtin/notes.c')
0 files changed, 0 insertions, 0 deletions