summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-07-16 01:27:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-16 21:27:39 (GMT)
commit4b048c917f9e2cc33771b61b8f12eeac10ea8a51 (patch)
tree15b601bfa96d1286e84406625efa174e4f752521 /strbuf.c
parent2770ccbdb23d6a02e60d5df3f70e476b8ea65262 (diff)
downloadgit-4b048c917f9e2cc33771b61b8f12eeac10ea8a51.zip
git-4b048c917f9e2cc33771b61b8f12eeac10ea8a51.tar.gz
git-4b048c917f9e2cc33771b61b8f12eeac10ea8a51.tar.bz2
strbuf: allocate space with GIT_MAX_HEXSZ
In order to be sure we have enough space to use with any hash algorithm, use GIT_MAX_HEXSZ to allocate space. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index b0716ac..0305561 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -921,7 +921,7 @@ void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
int abbrev_len)
{
int r;
- strbuf_grow(sb, GIT_SHA1_HEXSZ + 1);
+ strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
r = find_unique_abbrev_r(sb->buf + sb->len, oid, abbrev_len);
strbuf_setlen(sb, sb->len + r);
}