summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4baff50)
raw | patch | inline | side by side (parent: 4baff50)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 18 Apr 2006 21:26:43 +0000 (23:26 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 18 Apr 2006 21:44:58 +0000 (14:44 -0700) |
Set maximum filename length for binary files so that scaling won't be
triggered and result in invalid string access.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
triggered and result in invalid string access.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index 3a1e6ce619baca3d209adf0c21fb8de197e7e0ac..903afa168968038100b4ed8e92562d90146a7f19 100644 (file)
--- a/diff.c
+++ b/diff.c
for (i = 0; i < data->nr; i++) {
struct diffstat_file *file = data->files[i];
+ len = strlen(file->name);
+ if (max_len < len)
+ max_len = len;
+
if (file->is_binary || file->is_unmerged)
continue;
if (max_change < file->added + file->deleted)
max_change = file->added + file->deleted;
- len = strlen(file->name);
- if (max_len < len)
- max_len = len;
}
for (i = 0; i < data->nr; i++) {