diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-12-17 12:37:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-17 13:36:34 -0800 |
commit | 737e31af7ae365d6251bb196e06d18afda9c98a8 (patch) | |
tree | 4c1c2ff1534fe36b72470b7dc56800c8d1345e88 /abspath.c | |
parent | dfab6aaecfe9df67123efc778f6aea4e9814715a (diff) | |
download | git-737e31af7ae365d6251bb196e06d18afda9c98a8.tar.gz |
make_absolute_path(): check bounds when seeing an overlong symlink
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'abspath.c')
-rw-r--r-- | abspath.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -64,6 +64,8 @@ const char *make_absolute_path(const char *path) len = readlink(buf, next_buf, PATH_MAX); if (len < 0) die ("Invalid symlink: %s", buf); + if (PATH_MAX <= len) + die("symbolic link too long: %s", buf); next_buf[len] = '\0'; buf = next_buf; buf_index = 1 - buf_index; |