* mandoc: fix incomplete handling of roff(7) nodes in man(7) block
@ 2017-06-28 12:53 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-28 12:53 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-28 12:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 12:53 mandoc: fix incomplete handling of roff(7) nodes in man(7) block 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).