diff options
| author | Dmitry Potapov <dpotapov@gmail.com> | 2008-07-16 18:54:02 +0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2008-07-16 14:03:24 -0700 |
| commit | fd55a19eb1d49ae54008d932a65f79cd6fda45c9 (patch) | |
| tree | 924e7874961e54d268e36a1e71b6b88414dc421b /revision.c | |
| parent | Fix buffer overflow in git-grep (diff) | |
| download | git-fd55a19eb1d49ae54008d932a65f79cd6fda45c9.tar.gz git-fd55a19eb1d49ae54008d932a65f79cd6fda45c9.zip | |
Fix buffer overflow in git diff
If PATH_MAX on your system is smaller than a path stored, it may cause
buffer overflow and stack corruption in diff_addremove() and diff_change()
functions when running git-diff
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
| -rw-r--r-- | revision.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c index fc66755259..8dc3ca7bf6 100644 --- a/revision.c +++ b/revision.c @@ -259,7 +259,7 @@ static int tree_difference = REV_TREE_SAME; static void file_add_remove(struct diff_options *options, int addremove, unsigned mode, const unsigned char *sha1, - const char *base, const char *path) + const char *fullpath) { int diff = REV_TREE_DIFFERENT; @@ -285,7 +285,7 @@ static void file_change(struct diff_options *options, unsigned old_mode, unsigned new_mode, const unsigned char *old_sha1, const unsigned char *new_sha1, - const char *base, const char *path) + const char *fullpath) { tree_difference = REV_TREE_DIFFERENT; DIFF_OPT_SET(options, HAS_CHANGES); |
