diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2021-08-19 16:55:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2021-08-19 16:55:31 +0000 |
commit | fe0b0092185401581ba11b44f08520bad87fbeda (patch) | |
tree | 1096f1a2efcb13f92c8d2815670c1881f8d35784 | |
parent | cbbdb9798fbefe0870d5857631fb51afe0697da2 (diff) | |
download | mandoc-fe0b0092185401581ba11b44f08520bad87fbeda.tar.gz mandoc-fe0b0092185401581ba11b44f08520bad87fbeda.tar.zst mandoc-fe0b0092185401581ba11b44f08520bad87fbeda.zip |
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
-rw-r--r-- | mandocdb.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.268 2021/08/07 13:02:10 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.269 2021/08/19 16:55:31 schwarze Exp $ */ /* * Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> @@ -629,6 +629,8 @@ treescan(void) say(path, "&stat"); continue; } + if ((ff->fts_statp->st_mode & S_IFMT) != S_IFREG) + continue; /* FALLTHROUGH */ /* |