diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-21 01:52:53 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-21 01:52:53 +0000 |
commit | e5162e81380b9a4f3a519fe614576af26589f06f (patch) | |
tree | 3553277f5030eec3e2d45c6e5fb10361da80d8da /out.c | |
parent | bbc2a36ee2ac85ca438a009fda76b29d2bf869d8 (diff) | |
download | mandoc-e5162e81380b9a4f3a519fe614576af26589f06f.tar.gz |
We repeatedly observed assertion crashes in the low-level terminal
output handler because the high level terminal formatters could be
tricked into setting the left margin further to the right than the
right margin. Today, jsg@ found more of these with afl.
Change the internal interface between both levels, aiming for
simplicity and robustness of the code. Treat both margins as
*independent* settings: Now, termp.offset is the requested left
margin, and termp.rmargin is the available space. Let the lower
level cope with that case of insufficient space.
Obviously, high level code that does centering or flush right
still has to do careful checks, so i did a full audit of margin
settings in the terminal formatters.
Fixes crashes caused by excessively long title or date strings in
the man(7) footer, operating system or date strings in the mdoc(7)
footer, volume strings in the man(7) or mdoc(7) header, and a few
cases related to some non-prologue macros.
Diffstat (limited to 'out.c')
0 files changed, 0 insertions, 0 deletions