Commit 4b048c91 authored by brian m. carlson's avatar brian m. carlson Committed by Junio C Hamano

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's avatarbrian m. carlson <>
Signed-off-by: default avatarJunio C Hamano <>
parent 2770ccbd
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment