diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-14 16:28:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-14 16:28:38 +0000 |
commit | 251fb22aeecbbce2c8608e951b9042881f98244e (patch) | |
tree | c5cfe1741c12316451f5dcb098e507d8b796a73c /html.c | |
parent | 9ab0f1d2fbd0ca6762382443886903e11810663b (diff) | |
download | mandoc-251fb22aeecbbce2c8608e951b9042881f98244e.tar.gz mandoc-251fb22aeecbbce2c8608e951b9042881f98244e.tar.zst mandoc-251fb22aeecbbce2c8608e951b9042881f98244e.zip |
Fix an assertion failure triggered by print_otag("sw+-l", NULL).
Even though we skip the style when the argument is NULL,
we must still consume the options.
Not found with afl(1), but during manual testing of the previous patch...
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.217 2017/07/14 16:06:44 schwarze Exp $ */ +/* $Id: html.c,v 1.218 2017/07/14 16:28:38 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -624,8 +624,13 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...) su = va_arg(ap, struct roffsu *); break; case 'w': - if ((arg2 = va_arg(ap, char *)) == NULL) + if ((arg2 = va_arg(ap, char *)) == NULL) { + if (*fmt == '+') + fmt++; + if (*fmt == '-') + fmt++; break; + } su = &mysu; a2width(arg2, su); if (*fmt == '+') { |