From c7e9eaf82d8a0689a69d341a31f3ba3206e20bc3 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 15 Mar 2015 16:53:41 +0000 Subject: 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. --- man_term.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man_term.c b/man_term.c index 8be7927a..ad007c8c 100644 --- a/man_term.c +++ b/man_term.c @@ -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 * Copyright (c) 2010-2015 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451