summaryrefslogtreecommitdiff
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-09-24 21:07:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-25 17:18:18 (GMT)
commit495127dbcbd53e89d7edee8db42bfa7e57c8a120 (patch)
treea72a2916db245c5862ee09843059886b9f673b8c /builtin/upload-archive.c
parent0e265a92a1d2b9275d638f696c65c9bbe747e78c (diff)
downloadgit-495127dbcbd53e89d7edee8db42bfa7e57c8a120.zip
git-495127dbcbd53e89d7edee8db42bfa7e57c8a120.tar.gz
git-495127dbcbd53e89d7edee8db42bfa7e57c8a120.tar.bz2
resolve_ref: use strbufs for internal buffers
resolve_ref already uses a strbuf internally when generating pathnames, but it uses fixed-size buffers for storing the refname and symbolic refs. This means that you cannot actually point HEAD to a ref that is larger than 256 bytes. We can lift this limit by using strbufs here, too. Like sb_path, we pass the the buffers into our helper function, so that we can easily clean up all output paths. We can also drop the "unsafe" name from our helper function, as it no longer uses a single static buffer (but of course resolve_ref_unsafe is still unsafe, because the static buffers moved there). As a bonus, we also get to drop some strcpy calls between the two fixed buffers (that cannot currently overflow because the two buffers are sized identically). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions