dtfile: coverity CIDs 88363,88405,89140,89612; insecure readlink

This commit is contained in:
Jon Trulson
2018-04-01 13:43:48 -06:00
parent b4c4fb594d
commit 7fa35c29c4
3 changed files with 4 additions and 4 deletions

View File

@@ -187,7 +187,7 @@ CopyLink(char *sourceP, char *targetP, int repl, struct stat *statP)
} while (l < 0 && errno == EINTR);
if (l < 0)
return errno;
buf[l] = 0;
buf[l-1] = 0;
if (symlink(buf, targetP) == 0)
return 0;
else if (errno != EEXIST || !repl)