Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
strbuf: allocate space with GIT_MAX_HEXSZ
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 16 Jul 2018 01:27:57 +0000
(
01:27
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Jul 2018 21:27:39 +0000
(14:27 -0700)
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>
strbuf.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
2770ccb
)
diff --git
a/strbuf.c
b/strbuf.c
index b0716ac585285a971c04952254c34a00aab9f0ef..030556111d197e02bb2b2ed0796e683fe69391d6 100644
(file)
--- 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);
}