summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2023-01-01 17:51:27 +0000
committerColin Watson <cjwatson@debian.org>2023-01-01 17:51:27 +0000
commitbc2573614d40ccf457991223d6727e29486621f4 (patch)
tree8a25a416817203257fb85edaec7ce47e9fc718b1
parent3ac91c2a58755920d0ecf27b0f383189618f7161 (diff)
mandb: Fix crash when processing stray cats
Regression introduced in man-db 2.11.0. Fixes Debian bug #1027487. * src/straycats.c (check_for_stray): Pass a basic trace list to `store_descriptions`, since that's required as of commit d3e4b5522ae8152f10db0bb98e6873c9cc17ed59. * NEWS.md: Document this.
-rw-r--r--NEWS.md1
-rw-r--r--src/straycats.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS.md b/NEWS.md
index 3c142df1..724090ab 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,7 @@ Fixes:
* Fix compile and test failures when `troff` is not `groff`.
* Fix segfault in typical uses of `man` when `nroff` is not installed.
+ * Fix crash in `mandb` when processing stray cats.
man-db 2.11.1 (15 November 2022)
================================
diff --git a/src/straycats.c b/src/straycats.c
index 95e8750a..932230b0 100644
--- a/src/straycats.c
+++ b/src/straycats.c
@@ -251,13 +251,18 @@ static int check_for_stray (MYDBM_FILE dbf)
if (find_name_decompressed (decomp,
catdir_base,
&lg)) {
- gl_list_t descs;
+ gl_list_t descs, trace;
strays++;
descs = parse_descriptions
(mandir_base, lg.whatis);
+ trace = new_string_list (GL_ARRAY_LIST,
+ true);
+ gl_list_add_last (trace,
+ xstrdup (catdir));
store_descriptions (dbf, descs, info,
NULL, mandir_base,
- NULL);
+ trace);
+ gl_list_free (trace);
gl_list_free (descs);
} else if (quiet < 2)
error (0, 0, _("warning: %s: whatis parse for %s(%s) failed"),