Skip to content

Commit 4d9b580

Browse files
committed
Merge branch 'jc/oneline'
* jc/oneline: pp_header(): work around possible memory corruption
2 parents 9bee7aa + 4cd008a commit 4d9b580

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ static void pp_header(enum cmit_fmt fmt,
997997
len = linelen;
998998
if (fmt == CMIT_FMT_EMAIL)
999999
len = bound_rfc2047(linelen, encoding);
1000-
ALLOC_GROW(*buf_p, *ofs_p + len, *space_p);
1000+
ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p);
10011001
dst = *buf_p + *ofs_p;
10021002
*ofs_p += add_user_info("Author", fmt, dst,
10031003
line + 7, dmode, encoding);
@@ -1008,7 +1008,7 @@ static void pp_header(enum cmit_fmt fmt,
10081008
len = linelen;
10091009
if (fmt == CMIT_FMT_EMAIL)
10101010
len = bound_rfc2047(linelen, encoding);
1011-
ALLOC_GROW(*buf_p, *ofs_p + len, *space_p);
1011+
ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p);
10121012
dst = *buf_p + *ofs_p;
10131013
*ofs_p += add_user_info("Commit", fmt, dst,
10141014
line + 10, dmode, encoding);

0 commit comments

Comments
 (0)