From d8883d384e21f79e5955f74c7cbe1730f3c797d3 Mon Sep 17 00:00:00 2001 From: David Crosby Date: Tue, 21 Jul 2015 19:54:46 -0600 Subject: Remove overflow on readlink --- local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'local.c') diff --git a/local.c b/local.c index fa1685e..202e9c4 100644 --- a/local.c +++ b/local.c @@ -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); -- cgit v1.2.3