summaryrefslogtreecommitdiffstats
path: root/test-sandbox_init.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-04-23 14:02:17 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-04-23 14:02:17 +0000
commit90d64fa2f97635da52e38a1dfeba56f657a11bbd (patch)
treef1c411f721cf2e5205357314129ccefdb040d248 /test-sandbox_init.c
parentbddcaddd71aa306d9c5a606bc7ece6e2812925c5 (diff)
downloadmandoc-90d64fa2f97635da52e38a1dfeba56f657a11bbd.tar.gz
If the last data row of a tbl(7) contains nothing but a horizontal line,
do not skip closing the table and cleaning up memory at the end of the table in the HTML output module. This bug resulted in skipping the tblcalc() function and reusing the existing roffcol array for the next tbl(7) processed. If the next table had more columns than the one ending with a horizontal line in the last data row, uninitialized memory was read, potentially resulting in near-infinite output. The bug was introduced in rev. 1.29 (2018/11/26) but only fully exposed by rev. 1.38 (2021/09/09). Until rev. 1.37, it could only cause misformatting and invalid HTML output syntax but not huge output because up to that point, the function did not use the roffcol array. Nasty bug found the hard way by Michael Stapelberg on the production server manpages.debian.org. Michael also supplied example files and excellent instructions how to reproduce the bug, which was very difficult because no real-world manual page is known that triggers the bug by itself, so to reproduce the bug, mandoc(1) had to be invoked with at least two file name arguments.
Diffstat (limited to 'test-sandbox_init.c')
0 files changed, 0 insertions, 0 deletions