summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2012-11-16 13:25:34 +0000
committerschwarze <schwarze@openbsd.org>2012-11-16 13:25:34 +0000
commit606f14935ad56c181dc4337ef62904edfef33f45 (patch)
tree65147d516498ac097fcc476c058e41d936707b8f /usr.bin/mandoc/mdoc_macro.c
parenttwo spelling fixes; from John-Mark Gurney (freebsd -r243048); (diff)
downloadwireguard-openbsd-606f14935ad56c181dc4337ef62904edfef33f45.tar.xz
wireguard-openbsd-606f14935ad56c181dc4337ef62904edfef33f45.zip
Fix a crash triggered by .Bl -tag .It Xo .El .Sh found by florian@.
* When allocating a body end marker, copy the pointer to the normalized block information from the body block, avoiding the risk of subsequent null pointer derefence. * When inserting the body end marker into the syntax tree, do not try to copy that pointer from the parent block, because not being a direkt child of the block it belongs to is the whole point of a body end marker. * Even non-callable blocks (like Bd and Bl) can break other blocks; when this happens, postpone closing them out in the usual way.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r--usr.bin/mandoc/mdoc_macro.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index ea0af8c83d7..18493ae5282 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.74 2012/07/18 16:20:14 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.75 2012/11/16 13:25:34 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -734,7 +734,7 @@ blk_exp_close(MACRO_PROT_ARGS)
if (later &&
MDOC_EXPLICIT & mdoc_macros[later->tok].flags)
continue;
- if (MDOC_CALLABLE & mdoc_macros[n->tok].flags)
+ if (MDOC_It != n->tok)
later = n;
}