diff options
author | Joerg Sonnenberger <joerg@netbsd.org> | 2010-07-30 17:14:09 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@netbsd.org> | 2010-07-30 17:14:09 +0000 |
commit | ab333dd1eec81bf1291c5d106ee9db601ca97615 (patch) | |
tree | 759b6d83310e3c1f4107068e4fb9b2d49d43d762 | |
parent | 13040aee17cb3502918d0eebb954f90e53e6d675 (diff) | |
download | mandoc-ab333dd1eec81bf1291c5d106ee9db601ca97615.tar.gz mandoc-ab333dd1eec81bf1291c5d106ee9db601ca97615.tar.zst mandoc-ab333dd1eec81bf1291c5d106ee9db601ca97615.zip |
Don't crash for the following test case as reported by Jordan Gordeev:
.Bl -tag
.It
foo
...
-rw-r--r-- | mdoc_action.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index 928615ab..5bdc2fcd 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.77 2010/07/26 13:45:49 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.78 2010/07/30 17:14:09 joerg Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -660,6 +660,13 @@ post_bl_tagwidth(POST_ARGS) assert(MDOC_BLOCK == nn->type); nn = nn->head->child; + if (nn == NULL) { + /* No -width for .Bl and first .It is emtpy */ + if ( ! mdoc_nmsg(m, n, MANDOCERR_NOWIDTHARG)) + return(0); + break; + } + if (MDOC_TEXT == nn->type) { sz = strlen(nn->string) + 1; break; |