From c070642807053876d10f7d2e6a1e090eee114928 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 16 Nov 2012 13:40:36 +0000 Subject: 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. Completed and tested at the OpenBSD impromptu Coimbra hackathon (c2k12). Thanks to Pedro Almeida and the Laborat'orio de Computa,c~ao Avan,cada da Universidade de Coimbra (http://www.uc.pt/lca) for their hospitality! --- mdoc_macro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index 3e5d46af..29c6cff0 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -738,7 +738,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; } -- cgit