summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-08-10 12:29:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-08-10 12:29:38 +0000
commit8425d564a6c8625ee1a9ffd0a2757d9b2204d7ac (patch)
treecc1ecc203d8c2fb4a60e8e03c1be05a0c1a9f248 /mdoc_validate.c
parent7719ea3564dba8ec05799b28e3129d0a664c45f4 (diff)
downloadmandoc-8425d564a6c8625ee1a9ffd0a2757d9b2204d7ac.tar.gz
Don't printf("%s", NULL) if .It has a macro as an argument
in a list of a type where items don't takes arguments. Issue found by tb@ with afl(1).
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index a52358b4..f752d263 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1064,10 +1064,11 @@ post_it(POST_ARGS)
mdoc_argnames[nbl->args->argv[0].arg]);
/* FALLTHROUGH */
case LIST_item:
- if (nit->head->child != NULL)
+ if ((nch = nit->head->child) != NULL)
mandoc_vmsg(MANDOCERR_ARG_SKIP,
mdoc->parse, nit->line, nit->pos,
- "It %s", nit->head->child->string);
+ "It %s", nch->string == NULL ?
+ mdoc_macronames[nch->tok] : nch->string);
break;
case LIST_column:
cols = (int)nbl->norm->Bl.ncols;