Do not die on an assertion if an input file contains no section
authorschwarze <schwarze@openbsd.org>
Wed, 13 Apr 2022 14:37:34 +0000 (14:37 +0000)
committerschwarze <schwarze@openbsd.org>
Wed, 13 Apr 2022 14:37:34 +0000 (14:37 +0000)
commit6369db7023f81f1bf5ae71175457e3e9c7b146f3
tree13642db877464c1a1ac2cede52392708dd51de8a
parente6cf71aa9262c1ac742dbec4fd9e0714ae7d8350
Do not die on an assertion if an input file contains no section
whatsoever and ends with a broken next-line scope.  Obviously, this
cannot happen in a real manual page, but mandoc(1) should not die
even when fed absurd input.

This bug was independently reported by both jsg@ and tb@ who both
found it with afl(1).
regress/usr.bin/mandoc/man/TH/nobody.in
regress/usr.bin/mandoc/man/TH/nobody.out_ascii
regress/usr.bin/mandoc/man/TH/nobody.out_lint
usr.bin/mandoc/man_macro.c