diff options
author | Jeff King <peff@peff.net> | 2015-09-24 17:07:22 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-25 10:18:18 -0700 |
commit | 495127dbcbd53e89d7edee8db42bfa7e57c8a120 (patch) | |
tree | a72a2916db245c5862ee09843059886b9f673b8c /builtin/upload-archive.c | |
parent | 0e265a92a1d2b9275d638f696c65c9bbe747e78c (diff) | |
download | git-495127dbcbd53e89d7edee8db42bfa7e57c8a120.tar.gz |
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