From 251fb22aeecbbce2c8608e951b9042881f98244e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 14 Jul 2017 16:28:38 +0000 Subject: 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... --- html.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/html.c b/html.c index c6442783..28f8cf98 100644 --- a/html.c +++ b/html.c @@ -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 * Copyright (c) 2011-2015, 2017 Ingo Schwarze @@ -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 == '+') { -- cgit v1.2.3