When trying to expand some columns in a table where the sum of the
authorschwarze <schwarze@openbsd.org>
Mon, 1 May 2017 20:53:58 +0000 (20:53 +0000)
committerschwarze <schwarze@openbsd.org>
Mon, 1 May 2017 20:53:58 +0000 (20:53 +0000)
commiteb274914ae41075d7e8ac068dbde0e46a1d2fcc4
tree2ccb9dd8f9d39763760d589f1f2374bb57d2a86f
parent4bee05899b3c97b437ddb5f50e61a853043acda8
When trying to expand some columns in a table where the sum of the
widths of the remaining columns is already wider than the line
length, underflowing size_t and dying from ENOMEM is the wrong plan.
Instead, simply refrain from expanding anything in such a situation,
avoiding a crash that tb@ found with afl.
regress/usr.bin/mandoc/tbl/mod/Makefile
regress/usr.bin/mandoc/tbl/mod/expand-toowide.in [new file with mode: 0644]
regress/usr.bin/mandoc/tbl/mod/expand-toowide.out_ascii [new file with mode: 0644]
usr.bin/mandoc/out.c