diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-02-11 21:49:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-02-11 21:49:50 +0000 |
commit | 569cfcee61560d07f2e68e68d200da64b2c10f7e (patch) | |
tree | da2bf1d321bebdd944e538c933c671059419ff9e | |
parent | a81736faf5784c97e7a57a87da2da19e17539316 (diff) | |
download | mandoc-569cfcee61560d07f2e68e68d200da64b2c10f7e.tar.gz |
Do not read one element past the end of the static const termacts array.
Bug found by Sevan Janiyan <venture37 at geeklan dot co dot uk>
who ran the OpenBSD mandoc test suite on Ubuntu on POWER8 (sic!)
and reported that mdoc/Sh/before.in failed in -Tman mode.
If that isn't power testing, i don't know...
-rw-r--r-- | man_term.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -822,7 +822,8 @@ pre_SH(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_SH && n->body->child == NULL)) break; |