path: root/builtin/upload-archive.c
diff options
authorJeff King <>2015-09-24 21:07:22 (GMT)
committerJunio C Hamano <>2015-09-25 17:18:18 (GMT)
commit495127dbcbd53e89d7edee8db42bfa7e57c8a120 (patch)
treea72a2916db245c5862ee09843059886b9f673b8c /builtin/upload-archive.c
parent0e265a92a1d2b9275d638f696c65c9bbe747e78c (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions