summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-13 15:13:18 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-13 15:13:18 +0000
commit53d7cbc3682fd07a4bfcf8f68cf413cc35c89943 (patch)
tree063a55ee4e70d0715be1486467528573e4334c59
parent093b704b943e58cc16bd6065cc571372f7059b56 (diff)
downloadmandoc-53d7cbc3682fd07a4bfcf8f68cf413cc35c89943.tar.gz
eqn(7) .EQ has to break man(7) next-line scope, or tree corruption
and use after free many ensue; again found by jsg@ with afl(1)
-rw-r--r--roff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/roff.c b/roff.c
index 1d181d32..b3f80352 100644
--- a/roff.c
+++ b/roff.c
@@ -2879,6 +2879,8 @@ roff_EQ(ROFF_ARGS)
{
struct roff_node *n;
+ if (r->man->macroset == MACROSET_MAN)
+ man_breakscope(r->man, ROFF_EQ);
n = roff_node_alloc(r->man, ln, ppos, ROFFT_EQN, TOKEN_NONE);
if (ln > r->man->last->line)
n->flags |= NODE_LINE;