Remove overflow on readlink

This commit is contained in:
David Crosby
2015-07-21 19:54:46 -06:00
committed by Tatsuya Kinoshita
parent 7e5b33c30e
commit d8883d384e

View File

@@ -168,7 +168,7 @@ loadLocalDir(char *dname)
else {
#if defined(HAVE_LSTAT) && defined(HAVE_READLINK)
if (S_ISLNK(lst.st_mode)) {
if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf))) > 0) {
if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf) - 1)) > 0) {
lbuf[l] = '\0';
Strcat_m_charp(tmp, " -> ",
html_quote(conv_from_system(lbuf)), NULL);