Hi Otto,

Otto Moerbeek wrote on Thu, Jun 11, 2020 at 05:07:17PM +0200:

> This fixes it for me,

Indeed, i came up with exactly the same diff and had already
written this commit message, but was still testing:

  Fix a regression in rev. 1.238 (2019/07/26):
  Pass the right object to html_reset() or it will crash 
  when rendering more than one manual page to HTML in a row.
  Bug reported by Abel Romero Perez <romeroperezabel at gmail dot com>.

Given that you published the diff earlier, please commit, OK schwarze@.


This teaches once again that having type safety is really useful
and artificially circumventing it tends to invite trouble.

On first sight, it seems surprising that such a blatant regression
could survive almost a year.  Then again, the reason probably
is that

  <html>...</html><html>...</html>

isn't really valid HTML in the first place, so i guess few people
are using -T html with more than one input file at a time, and hence
the bug doesn't really bite in practically relevant use cases.

Yours,
  Ingo


> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mandoc/main.c,v
> retrieving revision 1.247
> diff -u -p -r1.247 main.c
> --- main.c    24 Feb 2020 21:15:05 -0000      1.247
> +++ main.c    11 Jun 2020 15:06:43 -0000
> @@ -872,7 +872,7 @@ parse(struct mparse *mp, int fd, const c
>       if (outst->outdata == NULL)
>               outdata_alloc(outst, outconf);
>       else if (outst->outtype == OUTT_HTML)
> -             html_reset(outst);
> +             html_reset(outst->outdata);
>  
>       mandoc_xr_reset();
>       meta = mparse_result(mp);
> 

Reply via email to