From: Junio C Hamano Date: Sat, 23 Jun 2007 06:33:08 +0000 (-0700) Subject: Merge branch 'jc/oneline' X-Git-Tag: v1.5.3-rc0~66 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4d9b58076395899e2501b7c2b3527c998f61619e?ds=inline;hp=-c Merge branch 'jc/oneline' * jc/oneline: pp_header(): work around possible memory corruption --- 4d9b58076395899e2501b7c2b3527c998f61619e diff --combined commit.c index f778bf4d6c,dbb28b593f..03436b1b07 --- a/commit.c +++ b/commit.c @@@ -27,7 -27,7 +27,7 @@@ struct sort_nod const char *commit_type = "commit"; -struct cmt_fmt_map { +static struct cmt_fmt_map { const char *n; size_t cmp_len; enum cmit_fmt v; @@@ -997,7 -997,7 +997,7 @@@ static void pp_header(enum cmit_fmt fmt len = linelen; if (fmt == CMIT_FMT_EMAIL) len = bound_rfc2047(linelen, encoding); - ALLOC_GROW(*buf_p, *ofs_p + len, *space_p); + ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p); dst = *buf_p + *ofs_p; *ofs_p += add_user_info("Author", fmt, dst, line + 7, dmode, encoding); @@@ -1008,7 -1008,7 +1008,7 @@@ len = linelen; if (fmt == CMIT_FMT_EMAIL) len = bound_rfc2047(linelen, encoding); - ALLOC_GROW(*buf_p, *ofs_p + len, *space_p); + ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p); dst = *buf_p + *ofs_p; *ofs_p += add_user_info("Commit", fmt, dst, line + 10, dmode, encoding);