discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
Cc: discuss@mdocml.bsd.lv
Subject: Re: mandoc -Thtml crashing for certain inputs
Date: Sat, 13 May 2017 15:47:53 +0200	[thread overview]
Message-ID: <20170513134753.GA89951@athene.usta.de> (raw)
In-Reply-To: <CAHwRYJ=QpUO4Gp+rAq1gjZ=2nHyX4hqE4FH-P7Qmavm3xSO9ww@mail.gmail.com>

Hi Abhinav,

Abhinav Upadhyay wrote on Sat, May 13, 2017 at 06:36:53PM +0530:

> mandoc -Thtml seems to be crashing in some cases, when you pass the
> -Ostyle option to it, such as `mandoc -Thtml -Ostyle=s/style.css'.
> 
>  The core indicates a null pointer dereference at line 754 in
> mdoc_html.c (1.14.1 release):
> 
> if (h->style != NULL && !bl->norm->Bl.comp &&
>      (n->parent->prev == NULL ||
>       n->parent->prev->body->child != NULL)) {
> ...
> 
> I am able to hit it with the following test case:
> 
> .Dd May 13, 2017
> .Dt FOO 8
> .Os
> .Sh NAME
> .Nm foo
> .Nd man page for foo
> .Sh DESCRIPTION
> foo bar
> .Bl -tag -width Ds
> .Sm off
> .It Ar device
> Open the specified device
> .El
> 
> It crashes because of the presence of `.Sm off' inside the list. The
> actual issue was happening while generating html for the rmt(8) man
> page from FreeBSD-12.0-current but I tried to reduce it down to a
> smaller test case for ease of debugging.

That crash was first reported by Gabriel Guzman and i fixed it
in mdoc_html.c rev. 1.272 on Feb 22, 2017.  The HEAD revision
of that file currently is rev. 1.287.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2017-05-13 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 13:06 Abhinav Upadhyay
2017-05-13 13:47 ` 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=20170513134753.GA89951@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mdocml.bsd.lv \
    --cc=er.abhinav.upadhyay@gmail.com \
    --subject='Re: mandoc -Thtml crashing for certain inputs' \
    /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

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).