diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-11 13:37:57 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-11 13:37:57 +0000 |
commit | 7f9cb114fd34b6f74fb89f6b29a4bfd2f7cf921d (patch) | |
tree | ac544de231ba73f1354ea489073a634160d9fa46 | |
parent | c353c55f27ec1d4e26535ef6c0c80284d2a3b47b (diff) | |
download | mandoc-7f9cb114fd34b6f74fb89f6b29a4bfd2f7cf921d.tar.gz mandoc-7f9cb114fd34b6f74fb89f6b29a4bfd2f7cf921d.tar.zst mandoc-7f9cb114fd34b6f74fb89f6b29a4bfd2f7cf921d.zip |
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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 579d98b0..5953bd45 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.181 2015/02/10 17:47:45 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.182 2015/02/11 13:37:57 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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 |