source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Do not mark a block with the MDOC_BROKEN flag if it merely
@ 2015-04-29 14:49 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-04-29 14:49 UTC (permalink / raw)
  To: source

Log Message:
-----------
Do not mark a block with the MDOC_BROKEN flag if it merely contains
a mismatching explicit end macro without actually being broken.
Avoids a subsequent upward search for the non-existent breaker 
ending up in a NULL pointer access; afl test case 005/Apr27 from jsg@.

Modified Files:
--------------
    mdocml:
        mdoc_macro.c

Revision Data
-------------
Index: mdoc_macro.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_macro.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.195 -r1.196
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -644,6 +644,8 @@ blk_exp_close(MACRO_PROT_ARGS)
 	if (body == NULL) {
 		mandoc_msg(MANDOCERR_BLK_NOTOPEN, mdoc->parse,
 		    line, ppos, mdoc_macronames[tok]);
+		if (later != NULL)
+			later->flags &= ~MDOC_BROKEN;
 		if (maxargs && endbody == NULL) {
 			/*
 			 * Stray .Ec without previous .Eo:
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2015-04-29 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29 14:49 mdocml: Do not mark a block with the MDOC_BROKEN flag if it merely 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).