From c94d9336f7688519926c170032e6f0da8c5d11c5 Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Sat, 4 Jun 2016 10:20:02 -0300 Subject: [PATCH] Fix off-by-one error in readlink() call. --- rover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rover.c b/rover.c index c809e31..afe7d34 100644 --- a/rover.c +++ b/rover.c @@ -810,7 +810,7 @@ static int cpyfile(const char *srcpath) { ret = lstat(srcpath, &st); if (ret < 0) return ret; if (S_ISLNK(st.st_mode)) { - ret = readlink(srcpath, BUF1, BUFLEN); + ret = readlink(srcpath, BUF1, BUFLEN-1); if (ret < 0) return ret; BUF1[ret] = '\0'; ret = symlink(BUF1, dstpath); -- 2.11.4.GIT