diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-15 16:53:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-15 16:53:41 +0000 |
commit | 12599968edd5ffa59b8a3921e7ca0f69f3bc1946 (patch) | |
tree | c888496e7ec38badd7b05a753fba8ca6b4f886bb | |
parent | b4eb29b2624d52eff69fd5b74c4d30165086dcf5 (diff) | |
download | mandoc-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |