summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index 8194ce1..649f34f 100644
--- a/abspath.c
+++ b/abspath.c
@@ -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;