diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-02-07 20:31:39 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-02-07 20:31:39 +0000 |
commit | 877d53b1f1db96eab611192f0f83cfd3817340f7 (patch) | |
tree | 090fb67c30e007332c536d84eff320a073cb833e /mandocdb.c | |
parent | e72b5790aad72ffb83f10306115d53d3a02ab6ac (diff) | |
download | mandoc-877d53b1f1db96eab611192f0f83cfd3817340f7.tar.gz |
In man(7) and cat pages, cut off excessive one line descriptions.
An extreme example of how rogue files could mess up apropos(1) output
was reported by bentley@: qwtlicense(3) in the x11/qwt port.
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1373,7 +1373,12 @@ parse_cat(struct mpage *mpage, int fd) plen -= 2; } - mpage->desc = mandoc_strdup(p); + /* + * Cut off excessive one-line descriptions. + * Bad pages are not worth better heuristics. + */ + + mpage->desc = mandoc_strndup(p, 150); fclose(stream); free(title); } @@ -1517,7 +1522,12 @@ parse_man(struct mpage *mpage, const struct roff_meta *meta, while (' ' == *start) start++; - mpage->desc = mandoc_strdup(start); + /* + * Cut off excessive one-line descriptions. + * Bad pages are not worth better heuristics. + */ + + mpage->desc = mandoc_strndup(start, 150); free(title); return; } |