source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Fix an assertion failure triggered by print_otag("sw+-l", NULL).
@ 2017-07-14 16:29 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-07-14 16:29 UTC (permalink / raw)
  To: source

Log Message:
-----------
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...

Modified Files:
--------------
    mandoc:
        html.c

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -Lhtml.c -Lhtml.c -u -p -r1.217 -r1.218
--- html.c
+++ html.c
@@ -624,8 +624,13 @@ print_otag(struct html *h, enum htmltag 
 			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 == '+') {
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-14 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 16:29 mandoc: Fix an assertion failure triggered by print_otag("sw+-l", NULL) schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).