tech@mandoc.bsd.lv
 help / color / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Baptiste Daroussin <bapt@FreeBSD.org>,
	Eygene Ryabinkin <rea@freebsd.org>
Cc: freebsd-current@FreeBSD.org, tech@mandoc.bsd.lv
Subject: Re: [CFT][patch] mandoc: don't segfault on empty tbl(1) continuation blocks
Date: Thu, 18 Jul 2019 17:00:18 +0200
Message-ID: <20190718150018.GB67545@athene.usta.de> (raw)
In-Reply-To: <20190717111655.eyq673itr76fj224@ivaldir.net>

Hi Baptiste, hi Eygene,

Baptiste Daroussin wrote on Wed, Jul 17, 2019 at 01:16:56PM +0200:
> On Wed, Jul 17, 2019 at 01:39:42PM +0300, Eygene Ryabinkin wrote:

>> but I believe that 'cpp' still can be NULL and will try to see
>> if it is triggerable.

I'm not sure what you mean here.

Do you think that in tbl_hrule(), there is a possibility that *cpp
might still be accessed even though cpp == NULL?  If so, where and
how exactly?

As far as i can see, cpp can indeed easily be NULL anywhere in 
tbl_hrule(), but it seems to me that for each access, != NULL
is checked immediately before.

If you still see a potential problem somewhere, please do speak up.
The table formatting logic is indeed complicated, so it's not
inconceivable that i still missed an edge case.

> As for the test case, the best would be that this test ends up
> incorporated in the upstream testsuite

Done, see the commit below.

Yours,
  Ingo


Log Message:
-----------
new test for an empty text block; from rea@ via bapt@ (FreeBSD)

Modified Files:
--------------
    mandoc/regress/tbl/data:
        Makefile

Added Files:
-----------
    mandoc/regress/tbl/data:
        block_empty.in
        block_empty.out_ascii

Revision Data
-------------
--- /dev/null
+++ regress/tbl/data/block_empty.in
@@ -0,0 +1,19 @@
+.\" $OpenBSD: block_empty.in,v 1.1 2019/07/18 14:38:47 schwarze Exp $
+.TH TBL-DATA-BLOCK_EMPTY 1 "July 17, 2019"
+.SH NAME
+tbl-data-block_empty \- empty text block
+.SH DESCRIPTION
+normal text
+.TS
+|l|l|.
+_
+A	test
+_
+table	T{
+T}
+_
+.TE
+.SH AUTHORS
+.MT rea@FreeBSD.org
+Eygene Ryabinkin
+.ME
--- /dev/null
+++ regress/tbl/data/block_empty.out_ascii
@@ -0,0 +1,22 @@
+TBL-DATA-BLOCK_EMPTY(1)     General Commands Manual    TBL-DATA-BLOCK_EMPTY(1)
+
+
+
+N\bNA\bAM\bME\bE
+       tbl-data-block_empty - empty text block
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       normal text
+
+       +------+------+
+       |A     | test |
+       +------+------+
+       |table |      |
+       +------+------+
+
+A\bAU\bUT\bTH\bHO\bOR\bRS\bS
+       Eygene Ryabinkin <rea@FreeBSD.org>
+
+
+
+OpenBSD                          July 17, 2019         TBL-DATA-BLOCK_EMPTY(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/tbl/data/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lregress/tbl/data/Makefile -Lregress/tbl/data/Makefile -u -p -r1.4 -r1.5
--- regress/tbl/data/Makefile
+++ regress/tbl/data/Makefile
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.4 2017/07/04 20:59:17 schwarze Exp $
+# $OpenBSD: Makefile,v 1.5 2019/07/18 14:38:47 schwarze Exp $
 
-REGRESS_TARGETS  = blankline block_unclosed block_width block_wrap empty insert
+REGRESS_TARGETS	 = blankline block_empty block_unclosed block_width
+REGRESS_TARGETS	+= block_wrap empty insert
 LINT_TARGETS	 = block_unclosed empty insert
 
 # groff-1.22.3 defect:
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190716193124.yrrntrtah22aky5n@phoenix.codelabs.ru>
     [not found] ` <20190717071201.beem6et6dybhby7m@ivaldir.net>
     [not found]   ` <20190717103942.fkunwe3utxvmdc5n@void.codelabs.ru>
2019-07-17 11:16     ` Baptiste Daroussin
2019-07-18 15:00       ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190718150018.GB67545@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=bapt@FreeBSD.org \
    --cc=freebsd-current@FreeBSD.org \
    --cc=rea@freebsd.org \
    --cc=tech@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

tech@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-tech

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.tech


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git