From 012b0a63e80b5d6c24ffc3ddc292861aa4132cc6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 30 Jan 2015 17:32:16 +0000 Subject: 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. --- man_term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'man_term.c') 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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; -- cgit v1.2.3