aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit012b0a63e80b5d6c24ffc3ddc292861aa4132cc6 (patch)
tree1b8cd94b439c7b75bd95c4f483f3886feea2ad6e /man_term.c
parent71fa4361c47e9ed2f3c6521e9273fabb41aadc20 (diff)
downloadmandoc-012b0a63e80b5d6c24ffc3ddc292861aa4132cc6.tar.gz
mandoc-012b0a63e80b5d6c24ffc3ddc292861aa4132cc6.tar.zst
mandoc-012b0a63e80b5d6c24ffc3ddc292861aa4132cc6.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/man_term.c b/man_term.c
index ab6e5b06..830f82cb 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.166 2015/01/24 02:41:49 schwarze Exp $ */
+/* $Id: man_term.c,v 1.167 2015/01/30 17:32:16 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;