diff options
author | Sean <seanlkml@sympatico.ca> | 2006-05-22 20:36:34 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-22 18:00:38 -0700 |
commit | e3008464e70d25b4926b97b1f86951d7a3cb938d (patch) | |
tree | d4dd1d5b3af849e6f4d83638d16bad9be6825dd8 /diff.c | |
parent | 884e3134a0002af1f8842768873fe9d041ed9a76 (diff) | |
download | git-e3008464e70d25b4926b97b1f86951d7a3cb938d.tar.gz git-e3008464e70d25b4926b97b1f86951d7a3cb938d.tar.xz |
Avoid segfault in diff --stat rename output.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -237,7 +237,7 @@ static char *pprint_rename(const char *a, const char *b) if (a_midlen < 0) a_midlen = 0; if (b_midlen < 0) b_midlen = 0; - name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7); + name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7); sprintf(name, "%.*s{%.*s => %.*s}%s", pfx_length, a, a_midlen, a + pfx_length, |