From fe0b0092185401581ba11b44f08520bad87fbeda Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 19 Aug 2021 16:55:31 +0000 Subject: 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 , and my patch also tested by him on NixOS --- mandocdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mandocdb.c b/mandocdb.c index 0ef661b2..a3360fe4 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -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 * Copyright (c) 2011, 2012 Kristaps Dzonsons @@ -629,6 +629,8 @@ treescan(void) say(path, "&stat"); continue; } + if ((ff->fts_statp->st_mode & S_IFMT) != S_IFREG) + continue; /* FALLTHROUGH */ /* -- cgit v1.2.3-56-ge451