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 | c7e9eaf82d8a0689a69d341a31f3ba3206e20bc3 (patch) | |
tree | 83f55242658757863eae69bdd7d3286fa85631b7 | |
parent | 57952d3568fc684859e0e7a04e942d11736c1792 (diff) | |
download | mandoc-c7e9eaf82d8a0689a69d341a31f3ba3206e20bc3.tar.gz mandoc-c7e9eaf82d8a0689a69d341a31f3ba3206e20bc3.tar.zst mandoc-c7e9eaf82d8a0689a69d341a31f3ba3206e20bc3.zip |
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 | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.169 2015/03/06 15:48:52 schwarze Exp $ */ +/* $Id: man_term.c,v 1.170 2015/03/15 16:53:41 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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; |