From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-3.sys.kth.se (smtp-3.sys.kth.se [130.237.48.192]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s7FDs8A1012997 for ; Fri, 15 Aug 2014 09:54:09 -0400 (EDT) Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-3.sys.kth.se (Postfix) with ESMTP id 55D9A2681 for ; Fri, 15 Aug 2014 15:54:07 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-3.sys.kth.se ([127.0.0.1]) by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ujTLd1X5xBgP for ; Fri, 15 Aug 2014 15:53:56 +0200 (CEST) X-KTH-Auth: kristaps [2a02:1205:5033:5b0:846b:e2fb:5af3:9c13] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from [IPv6:2a02:1205:5033:5b0:846b:e2fb:5af3:9c13] (unknown [IPv6:2a02:1205:5033:5b0:846b:e2fb:5af3:9c13]) by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 1CF49266D for ; Fri, 15 Aug 2014 15:53:51 +0200 (CEST) Message-ID: <53EE10ED.5090400@bsd.lv> Date: Fri, 15 Aug 2014 15:53:49 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Crash in mandoc HEAD Content-Type: multipart/mixed; boundary="------------080602010206030308030303" This is a multi-part message in MIME format. --------------080602010206030308030303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi folks, I managed to crash mandoc(1) today while formatting a manual. Narrowed down: 1 .Dd $Mdocdate$ 2 .Dt FOO 1 3 .Os 4 .Sh NAME 5 .Nm foo 6 .Nd bar 7 .Sh DESCRIPTION 8 The 9 .Bl -hang 10 .It Nm Fo o 11 xyzzy 12 .El In short, the "Fo" is continuing a node subtree perpetually and the HEAD for the "It" on line 10 just keeps going. There's a check for "n->next->child" which thus crashes because "n->next" is NULL. The fix is very simple and enclosed. Ok? Best, Kristaps --------------080602010206030308030303 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="itcrash.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="itcrash.diff" Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.276 diff -u -p -r1.276 mdoc_term.c --- mdoc_term.c 10 Aug 2014 23:54:41 -0000 1.276 +++ mdoc_term.c 15 Aug 2014 13:53:07 -0000 @@ -806,7 +806,7 @@ termp_it_pre(DECL_ARGS) * the "overstep" effect in term_flushln() and treat * this as a `-ohang' list instead. */ - if (n->next->child && + if (NULL != n->next && NULL != n->next->child && (MDOC_Bl == n->next->child->tok || MDOC_Bd == n->next->child->tok)) break; --------------080602010206030308030303-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv