summaryrefslogtreecommitdiffstats
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-30 17:32:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-30 17:32:16 +0000
commitfa0509ac63ac6d0a43a709893722ed6ca5f80611 (patch)
treeff27fe4b98063dd10dbfc48b8d77712105d72c7c /man_term.c
parent37b1fa2022515dadb78d40e740849dfc6bd68996 (diff)
downloadmandoc-fa0509ac63ac6d0a43a709893722ed6ca5f80611.tar.gz
Delete the redundant tbl span flags, just inspect the actual data
where needed, which is less fragile. This fixes a subtle NULL pointer access to tp->tbl.cols: Due to a bug in the man(7) parser, the first span of a table can end up in a .TP head, in which case tblcalc() was never called. Found by jsg@ with afl.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/man_term.c b/man_term.c
index 28d2a10f..764ad016 100644
--- a/man_term.c
+++ b/man_term.c
@@ -949,7 +949,7 @@ print_man_node(DECL_ARGS)
* Tables are preceded by a newline. Then process a
* table line, which will cause line termination,
*/
- if (TBL_SPAN_FIRST & n->span->flags)
+ if (n->span->prev == NULL)
term_newln(p);
term_tbl(p, n->span);
return;