diff options
author | Colin Watson <cjwatson@debian.org> | 2022-12-31 23:01:03 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-12-31 23:01:04 +0000 |
commit | cb0947a6a4bf24f091d3c8e635791a9c50d5d799 (patch) | |
tree | 2c2e144f4b19aa0ea57875925abb747b79f499ec | |
parent | 206b2ff154d0793b344abb09d5b4459e331554aa (diff) |
Fix segfault when nroff is not installed
* src/man.c (try_section): Only free the `names` list if it is non-NULL
due to `NROFF_MISSING` being defined, and return early if options are
set such that cat files cannot be used either.
* NEWS.md: Document this.
-rw-r--r-- | NEWS.md | 1 | ||||
-rw-r--r-- | src/man.c | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -4,6 +4,7 @@ man-db 2.11.2 Fixes: * Fix compile and test failures when `troff` is not `groff`. + * Fix segfault in typical uses of `man` when `nroff` is not installed. man-db 2.11.1 (15 November 2022) ================================ @@ -3182,12 +3182,15 @@ static int try_section (const char *path, const char *sec, const char *name, return 1; if (!troff && !want_encoding && !recode) { - gl_list_free (names); + if (names) + gl_list_free (names); names = look_for_file (path, sec, name, true, lff_opts); cat = 1; } } + if (!names) + return 0; order_files (path, &names); |