Fix reading symlinks

The st_size field of a symlink doesn't have to be correct, e.g. for
/dev/fd symlinks.
This commit is contained in:
Eelco Dolstra
2016-03-02 15:46:07 +01:00
parent 0a62d9b3d7
commit 6055d84beb
+1 -1
View File
@@ -209,7 +209,7 @@ Path readLink(const Path & path)
else if (rlsize > st.st_size)
throw Error(format("symbolic link %1% size overflow %2% > %3%")
% path % rlsize % st.st_size);
return string(buf, st.st_size);
return string(buf, rlsize);
}