Re: [CFT][patch] mandoc: don't segfault on empty tbl(1) continuation blocks

From: Eygene Ryabinkin <rea_at_freebsd.org>
Date: Wed, 17 Jul 2019 13:39:42 +0300
Baptiste, good day.

Wed, Jul 17, 2019 at 09:12:02AM +0200, Baptiste Daroussin wrote:
> On Tue, Jul 16, 2019 at 10:31:24PM +0300, Eygene Ryabinkin wrote:
> > Attached is the patch that makes built-in tbl(1) processor in
> > mandoc to avoid dumping core when it renders the table with empty
> > "T{ T}" block and horizontally-ruled table.
>
> Thank you for the patch! Have it been discussed with upstream? I
> kind of remind something like this being reported to upstream, but I
> haven't checked the status.

Was fixed:
  https://mandoc.bsd.lv/cgi-bin/cvsweb/tbl_term.c.diff?r1=1.69&r2=1.70
  https://github.com/openbsd/src/commit/5f6e3232931ab08da9c8121d568c8207c0c4662c#diff-bc5842dc5d7897de7bdac08f74804c57
A bit differently: people just check for dpn->string being NULL.

And there is another one NULL pointer fix,
  https://mandoc.bsd.lv/cgi-bin/cvsweb/tbl_term.c.diff?r1=1.70&r2=1.71
  https://github.com/openbsd/src/commit/7514a273fe4561e94f1277f4ee5991c9af9cba2e#diff-bc5842dc5d7897de7bdac08f74804c57
Can't trigger it with upstream's testcase,
  https://mandoc.bsd.lv/cgi-bin/cvsweb/regress/tbl/layout/shortlines.in?rev=1.1&content-type=text/x-cvsweb-markup
  https://raw.githubusercontent.com/openbsd/src/7514a273fe4561e94f1277f4ee5991c9af9cba2e/regress/usr.bin/mandoc/tbl/layout/shortlines.in
since current FreeBSD's mandoc lacks this modification,
  https://mandoc.bsd.lv/cgi-bin/cvsweb/tbl_term.c.diff?r1=1.68&r2=1.69
  https://github.com/openbsd/src/commit/b3e6a3251dfa92e66aa539518119564bd1945cc0#diff-bc5842dc5d7897de7bdac08f74804c57
but I believe that 'cpp' still can be NULL and will try to see
if it is triggerable.

So, the patch that corresponds to the upstream change is attached.

Nothing was released after 1.14.5 (yet).  What will be the route?
Will you
 - wait for the new release;
   - if yes, will you incorporate the testing part?
 - if no, I think you will use the closer-to-upstream patch?

Thanks.
-- 
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

Received on Wed Jul 17 2019 - 08:39:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC