summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-15 16:53:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-15 16:53:41 +0000
commit12599968edd5ffa59b8a3921e7ca0f69f3bc1946 (patch)
treec888496e7ec38badd7b05a753fba8ca6b4f886bb
parentb4eb29b2624d52eff69fd5b74c4d30165086dcf5 (diff)
downloadmandoc-12599968edd5ffa59b8a3921e7ca0f69f3bc1946.tar.gz
Avoid off-by-one read access to the termacts array, which could
sometimes result in missing line breaks before subsection headers. Found by carsten dot kunze at arcor dot de on SuSE 13.2.
-rw-r--r--man_term.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/man_term.c b/man_term.c
index 4d95e9f4..b747ba1e 100644
--- a/man_term.c
+++ b/man_term.c
@@ -743,7 +743,8 @@ pre_SS(DECL_ARGS)
do {
n = n->prev;
- } while (n != NULL && termacts[n->tok].flags & MAN_NOTEXT);
+ } while (n != NULL && n->tok != MAN_MAX &&
+ termacts[n->tok].flags & MAN_NOTEXT);
if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL))
break;