summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-08-19 16:55:31 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-08-19 16:55:31 +0000
commit85c3fdaead0d311f9f74a2da69f7ba1e8fe998fd (patch)
tree58df22497b1da90ff20630277a969ba0344a57c8 /mandocdb.c
parentc8b9d4298c238425ec68dad55b5f7411180338b6 (diff)
downloadmandoc-85c3fdaead0d311f9f74a2da69f7ba1e8fe998fd.tar.gz
do not crash when a manpath directory contains a symbolic link
that points to a directory rather than to a regular file; bug reported by Lukas Epple <sternenseemann at systemli dot org>, and my patch also tested by him on NixOS
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mandocdb.c b/mandocdb.c
index cbbb8f60..bc432070 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -629,6 +629,8 @@ treescan(void)
say(path, "&stat");
continue;
}
+ if ((ff->fts_statp->st_mode & S_IFMT) != S_IFREG)
+ continue;
/* FALLTHROUGH */
/*