summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-11 13:37:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-11 13:37:57 +0000
commitac2fcf5a79f33c981e28a5af1816f1f29d7a0be5 (patch)
tree1aadb922f14ed5ead1d02fcbcf710eafe2daf713
parentf3138b20a341b989240218c6f5d74bbef7fae89e (diff)
downloadmandoc-ac2fcf5a79f33c981e28a5af1816f1f29d7a0be5.tar.gz
explicit blocks close out .Nd; fixing data structure corruption
eventually leading to NULL pointer access; found by jsg@ with afl, text case #455.
-rw-r--r--mdoc_macro.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 93a9adcf..03317c72 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -630,6 +630,13 @@ blk_exp_close(MACRO_PROT_ARGS)
break;
}
+ /* Explicit blocks close out description lines. */
+
+ if (n->tok == MDOC_Nd) {
+ rew_last(mdoc, n);
+ continue;
+ }
+
/*
* When finding an open sub block, remember the last
* open explicit block, or, in case there are only