use readlink with bufsize - 1, From NetBSD
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11662 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -268,7 +268,7 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
|
||||
}
|
||||
if(S_ISLNK(st->st_mode)) {
|
||||
int n;
|
||||
n = readlink((char *)filename, buf, sizeof(buf));
|
||||
n = readlink((char *)filename, buf, sizeof(buf) - 1);
|
||||
if(n >= 0) {
|
||||
buf[n] = '\0';
|
||||
file->link = strdup(buf);
|
||||
|
Reference in New Issue
Block a user