man: fix segfault in "man 1"

function                                             old     new   delta
man_main                                             942     954     +12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-06-15 14:47:46 +02:00
parent e47000490c
commit 4d4fc5ca5e

View File

@ -324,7 +324,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
/* is 1st ARG a SECTION? */
sec_list = conf_sec_list;
if (is_section_name(conf_sec_list, *argv)) {
if (is_section_name(conf_sec_list, *argv) && argv[1]) {
/* yes */
sec_list = *argv++;
}