From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout.scc.kit.edu (scc-mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pAJDWKut012730 for ; Sat, 19 Nov 2011 08:32:21 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1RRl1o-0003rD-4M; Sat, 19 Nov 2011 14:32:20 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RRl1o-0000mA-3a for tech@mdocml.bsd.lv; Sat, 19 Nov 2011 14:32:20 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RRl1o-0004SN-2b for tech@mdocml.bsd.lv; Sat, 19 Nov 2011 14:32:20 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RRl1o-0002N5-1J for tech@mdocml.bsd.lv; Sat, 19 Nov 2011 14:32:20 +0100 Date: Sat, 19 Nov 2011 14:32:20 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: mdocml: Bail out explicitly on invalid .Rs content like: .Rs plain text Message-ID: <20111119133220.GB28954@iris.usta.de> References: <201111181458.pAIEwOCM016755@krisdoz.my.domain> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111181458.pAIEwOCM016755@krisdoz.my.domain> User-Agent: Mutt/1.5.21 (2010-09-15) 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