summaryrefslogtreecommitdiffstats
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@netbsd.org>2010-07-30 17:14:09 +0000
committerJoerg Sonnenberger <joerg@netbsd.org>2010-07-30 17:14:09 +0000
commitb32f5641bf799d9214c355afab250b4a211f09e4 (patch)
treec61fb6fe0058f03e6b72b96f29c7ac8d10b2fce9 /mdoc_action.c
parent3348e4f57efdbb278df0f2592c876d0830c8c995 (diff)
downloadmandoc-b32f5641bf799d9214c355afab250b4a211f09e4.tar.gz
Don't crash for the following test case as reported by Jordan Gordeev:
.Bl -tag .It foo ...
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 317fa54a..023d496b 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -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;