From 4b048c917f9e2cc33771b61b8f12eeac10ea8a51 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 16 Jul 2018 01:27:57 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- strbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'strbuf.c') diff --git a/strbuf.c b/strbuf.c index b0716ac585..030556111d 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); } -- cgit v1.2.3