diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-09-20 14:20:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-09-20 14:20:48 +0000 |
commit | 060ebc4b9b443f3211bea13029632350ecd40296 (patch) | |
tree | 800adc09e1f7ab79cd938c6a681fe0c5cfea6a6f /usr.bin | |
parent | cafc03b392a793ed452bbf8926a9d0c755fd3f0a (diff) |
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 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/man_term.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index b9e0113521b..a7687312058 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.74 2011/09/20 13:13:21 schwarze Exp $ */ +/* $Id: man_term.c,v 1.75 2011/09/20 14:20:47 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -636,7 +636,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; |