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 206ce66c for ; Wed, 28 Jun 2017 07:53:15 -0500 (EST) Date: Wed, 28 Jun 2017 07:53:15 -0500 (EST) Message-Id: <4765525107544201796.enqueue@fantadrom.bsd.lv> X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: fix incomplete handling of roff(7) nodes in man(7) block X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- fix incomplete handling of roff(7) nodes in man(7) block next-line scope; assertion failure in tclsh(1) reported by deraadt@ via bentley@ Modified Files: -------------- mandoc: man.c Revision Data ------------- Index: man.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/man.c,v retrieving revision 1.175 retrieving revision 1.176 diff -Lman.c -Lman.c -u -p -r1.175 -r1.176 --- man.c +++ man.c @@ -282,8 +282,10 @@ man_breakscope(struct roff_man *man, int if (man->flags & MAN_ELINE && (tok < MAN_TH || ! (man_macros[tok].flags & MAN_NSCOPED))) { n = man->last; - assert(n->type != ROFFT_TEXT); - if (man_macros[n->tok].flags & MAN_NSCOPED) + if (n->type == ROFFT_TEXT) + n = n->parent; + if (n->tok < MAN_TH || + man_macros[n->tok].flags & MAN_NSCOPED) n = n->parent; mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, @@ -319,7 +321,8 @@ man_breakscope(struct roff_man *man, int n = man->last; if (n->type == ROFFT_TEXT) n = n->parent; - if ( ! (man_macros[n->tok].flags & MAN_BSCOPE)) + if (n->tok < MAN_TH || + (man_macros[n->tok].flags & MAN_BSCOPE) == 0) n = n->parent; assert(n->type == ROFFT_HEAD); -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv