* Re: mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text [not found] <201111181458.pAIEwOCM016755@krisdoz.my.domain> @ 2011-11-19 13:32 ` Ingo Schwarze 2011-11-20 4:27 ` Joerg Sonnenberger 0 siblings, 1 reply; 3+ messages in thread From: Ingo Schwarze @ 2011-11-19 13:32 UTC (permalink / raw) To: tech Hi Joerg, i could confirm both the problem and the fix, and i don't see any regressions, so i have merged this to OpenBSD and improved the comment a bit. Thanks, Ingo joerg@mdocml.bsd.lv wrote on Fri, Nov 18, 2011 at 09:58:24AM -0500: > Log Message: > ----------- > Bail out explicitly on invalid .Rs content like: > .Rs > plain text > .Re > > This avoids a crash on invalid. > > Modified Files: > -------------- > mdocml: > mdoc_validate.c > > Revision Data > ------------- > Index: mdoc_validate.c > =================================================================== > RCS file: /home/joerg/cvsroot/mdocml/mdoc_validate.c,v > retrieving revision 1.177 > retrieving revision 1.178 > diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.177 -r1.178 > --- mdoc_validate.c > +++ mdoc_validate.c > @@ -1693,6 +1693,10 @@ post_rs(POST_ARGS) > mdoc_node_delete(mdoc, nn); > } > > + /* Bail out early if a plain text node is found inside .Rs. */ > + if (NULL == mdoc->last->child) > + return(1); > + > /* > * The full `Rs' block needs special handling to order the > * sub-elements according to `rsord'. Pick through each element -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text 2011-11-19 13:32 ` mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text Ingo Schwarze @ 2011-11-20 4:27 ` Joerg Sonnenberger 2011-11-20 12:37 ` Ingo Schwarze 0 siblings, 1 reply; 3+ messages in thread From: Joerg Sonnenberger @ 2011-11-20 4:27 UTC (permalink / raw) To: tech On Sat, Nov 19, 2011 at 02:32:20PM +0100, Ingo Schwarze wrote: > i could confirm both the problem and the fix, and i don't see any > regressions, so i have merged this to OpenBSD and improved the > comment a bit. There is one aspect to consider. We drop .Rs plain text .Re silently now, when groff renders it. Joerg -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text 2011-11-20 4:27 ` Joerg Sonnenberger @ 2011-11-20 12:37 ` Ingo Schwarze 0 siblings, 0 replies; 3+ messages in thread From: Ingo Schwarze @ 2011-11-20 12:37 UTC (permalink / raw) To: tech Hi Joerg, Joerg Sonnenberger wrote on Sun, Nov 20, 2011 at 05:27:41AM +0100: > On Sat, Nov 19, 2011 at 02:32:20PM +0100, Ingo Schwarze wrote: >> i could confirm both the problem and the fix, and i don't see any >> regressions, so i have merged this to OpenBSD and improved the >> comment a bit. > There is one aspect to consider. We drop > .Rs > plain text > .Re > silently now, when groff renders it. Sure, i have a test case for that in my private collection of failing test cases. If anybody considers it of sufficient importance, feel free to add it to TODO. Typically, i add stuff to TODO when i see a case in practice where it matters, and i haven't yet seen one involving plain text in .Rs. ischwarze@isnote $ cd /usr/src/regress/usr.bin/mandoc/TODO/ ischwarze@isnote $ find . -name '*.in' | wc -l 98 For the time being, your patch prevents a crash, which is already a real improvement. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-20 12:37 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <201111181458.pAIEwOCM016755@krisdoz.my.domain> 2011-11-19 13:32 ` mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text Ingo Schwarze 2011-11-20 4:27 ` Joerg Sonnenberger 2011-11-20 12:37 ` Ingo 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).