From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id d759d699; for ; Wed, 29 Apr 2015 09:49:23 -0500 (EST) Date: Wed, 29 Apr 2015 09:49:23 -0500 (EST) Message-Id: <55083886193173940.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Do not mark a block with the MDOC_BROKEN flag if it merely X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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