summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-29 14:48:53 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-29 14:48:53 +0000
commitdb57abddea61d27902926e8bc578816ece975d27 (patch)
tree562ac18d67e58816a4bcf2eb13fe6aa0fa37aac2 /mdoc_macro.c
parentf7b136b7e6f8f82ddfee731bb4f5519e3c57b2fb (diff)
downloadmandoc-db57abddea61d27902926e8bc578816ece975d27.tar.gz
Do not mark a block with the MDOC_BROKEN flag if it merely contains
a mismatching explicit end macro without actually being broken. Avoids a subsequent upward search for the non-existent breaker ending up in a NULL pointer access; afl test case 005/Apr27 from jsg@.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 115fefe8..0ac00cd8 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -644,6 +644,8 @@ blk_exp_close(MACRO_PROT_ARGS)
if (body == NULL) {
mandoc_msg(MANDOCERR_BLK_NOTOPEN, mdoc->parse,
line, ppos, mdoc_macronames[tok]);
+ if (later != NULL)
+ later->flags &= ~MDOC_BROKEN;
if (maxargs && endbody == NULL) {
/*
* Stray .Ec without previous .Eo: