discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
To: discuss@mdocml.bsd.lv
Subject: mandoc -Thtml crashing for certain inputs
Date: Sat, 13 May 2017 18:36:53 +0530	[thread overview]
Message-ID: <CAHwRYJ=QpUO4Gp+rAq1gjZ=2nHyX4hqE4FH-P7Qmavm3xSO9ww@mail.gmail.com> (raw)

Hi,

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.

-
Abhinav
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 13:06 Abhinav Upadhyay [this message]
2017-05-13 13:47 ` Ingo Schwarze

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='CAHwRYJ=QpUO4Gp+rAq1gjZ=2nHyX4hqE4FH-P7Qmavm3xSO9ww@mail.gmail.com' \
    --to=er.abhinav.upadhyay@gmail.com \
    --cc=discuss@mdocml.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).