aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Crosby <dave@dafyddcrosby.com>2015-07-22 01:54:46 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-08-11 12:59:27 +0000
commitd8883d384e21f79e5955f74c7cbe1730f3c797d3 (patch)
tree1ceee16c440d457ffa57c1edbe6b920eab987998
parentRemove dead assignments flagged by Clang static analysis (diff)
downloadw3m-d8883d384e21f79e5955f74c7cbe1730f3c797d3.tar.gz
w3m-d8883d384e21f79e5955f74c7cbe1730f3c797d3.zip
Remove overflow on readlink
-rw-r--r--local.c2
1 files changed, 1 insertions, 1 deletions
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);