diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-20 14:20:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-20 14:20:48 +0000 |
commit | 923f10c1dbf6234d1a2ab1a268fe7b81a3841198 (patch) | |
tree | 7a739a01c96a4dbbf7a2e430ceac18b8ac3aeb65 /man_term.c | |
parent | 5402c1b9a0d8a1e61e1a3179ed694c6923e09990 (diff) | |
download | mandoc-923f10c1dbf6234d1a2ab1a268fe7b81a3841198.tar.gz mandoc-923f10c1dbf6234d1a2ab1a268fe7b81a3841198.tar.zst mandoc-923f10c1dbf6234d1a2ab1a268fe7b81a3841198.zip |
Using user-defined macros, surprisingly, it is possible
to have *next*-line head arguments on the *same* input line.
So .TP must not assume that a head argument with a matching
input line number is a same-line argument (and access a NULL pointer).
Bug found and fix tested by kristaps@ with groff_hdtbl(7).
Diffstat (limited to 'man_term.c')
-rw-r--r-- | man_term.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.119 2011/09/20 13:13:23 schwarze Exp $ */ +/* $Id: man_term.c,v 1.120 2011/09/20 14:20:48 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -640,7 +640,7 @@ pre_TP(DECL_ARGS) /* Calculate offset. */ if (NULL != (nn = n->parent->head->child)) - if (nn->parent->line == nn->line) + if (nn->string && nn->parent->line == nn->line) if ((ival = a2width(p, nn->string)) >= 0) len = (size_t)ival; |