Fix two issues causing a class of assertion failures found by jsg@ with afl.
authorschwarze <schwarze@openbsd.org>
Sat, 20 Dec 2014 02:26:42 +0000 (02:26 +0000)
committerschwarze <schwarze@openbsd.org>
Sat, 20 Dec 2014 02:26:42 +0000 (02:26 +0000)
commit42c9ede6f67e9ee0627823d05205159b281d7546
treea3b98e2909edb1e3b876f4e7cb9cc4e6bc3e352b
parent4dda31b3e16ed95bb65110199c079be23803c058
Fix two issues causing a class of assertion failures found by jsg@ with afl.
1) rew_sub(): Make sure REWIND_MORE is acted upon even when followed by
REWIND_NONE.  This prevents .It from ending up inside other children of .Bl.
2) blk_exp_close(): Only allow extension of .Bl when it has at least
one .It.  Otherwise, a broken child block could be moved in front of
the .Bl, effectively resulting in a .Bl that ended before it began.
regress/usr.bin/mandoc/mdoc/Bl/Makefile
regress/usr.bin/mandoc/mdoc/Bl/breakingIt.in [new file with mode: 0644]
regress/usr.bin/mandoc/mdoc/Bl/breakingIt.out_ascii [new file with mode: 0644]
regress/usr.bin/mandoc/mdoc/Bl/breakingIt.out_lint [new file with mode: 0644]
usr.bin/mandoc/mdoc_macro.c