diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-08-30 19:00:14 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-08-30 19:00:14 +0000 |
commit | 3e2ccabb99fdf7207092e29697a26a5045ab784d (patch) | |
tree | 3674fe9a4d30120efb4d078729a311d58f9a3c00 | |
parent | c811b41609dc2a80154d0dec89ac310da527f301 (diff) | |
download | mandoc-3e2ccabb99fdf7207092e29697a26a5045ab784d.tar.gz mandoc-3e2ccabb99fdf7207092e29697a26a5045ab784d.tar.zst mandoc-3e2ccabb99fdf7207092e29697a26a5045ab784d.zip |
If an .Fo macro lacks its mandatory argument, don't die on an assertion.
Bug found by jsg@ with afl.
-rw-r--r-- | mdoc_html.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 85be95b6..fb37f7e1 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.232 2015/04/18 17:53:21 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.233 2015/08/30 19:00:14 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -1642,11 +1642,10 @@ mdoc_fo_pre(MDOC_ARGS) return(1); } - /* XXX: we drop non-initial arguments as per groff. */ + if (n->child == NULL) + return(0); - assert(n->child); assert(n->child->string); - PAIR_CLASS_INIT(&tag, "fname"); t = print_otag(h, TAG_B, 1, &tag); print_text(h, n->child->string); |