author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 15 Jun 2007 12:19:07 +0000 (13:19 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jun 2007 00:55:58 +0000 (17:55 -0700) | ||
commit | 4cd008a925f3c7c0064d86a4cb4b06278e79e9e7 | |
tree | a67e024b27d62e53a7f430f364daab6af0cc3e60 | tree | snapshot |
parent | c927e6c69b50877e116340671ed35aaf6d3a8f49 | commit | diff |
pp_header(): work around possible memory corruption
add_user_info() possibly adds way more than just the commit header line.
In fact, it sometimes needs so much more space that there is a buffer
overrun, leading to an ugly crash. For example, the date is printed in its
own line, and usually takes up more space than the equivalent Unix epoch.
So, for good measure, add 80 characters (a full line) to the allocated
space, in addition to the header line length.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add_user_info() possibly adds way more than just the commit header line.
In fact, it sometimes needs so much more space that there is a buffer
overrun, leading to an ugly crash. For example, the date is printed in its
own line, and usually takes up more space than the equivalent Unix epoch.
So, for good measure, add 80 characters (a full line) to the allocated
space, in addition to the header line length.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c | diff | blob | history |