summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-19 04:58:35 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-19 04:58:35 +0000
commita40eca4c1b8dab3da5f695f89a86dcad5b0692b6 (patch)
tree2ba9c3d32e73f4ac4a4cb140ac8bd061bdac1f6b /term.c
parentfb223c54c7d41a098ab77102f18292a41eb1a7ea (diff)
downloadmandoc-a40eca4c1b8dab3da5f695f89a86dcad5b0692b6.tar.gz
Rewrite the low-level UTF-8 parser from scratch.
It accepted invalid byte sequences like 0xc080-c1bf, 0xe08080-e09fbf, 0xeda080-edbfbf, and 0xf0808080-f08fbfbf, produced valid roff Unicode escape sequences from them, and the algorithm contained strong defenses against any attempt to fix it. This cures an assertion failure in the terminal formatter caused by sneaking in ASCII 0x08 (backspace) by "encoding" it as an (invalid) multibyte UTF-8 sequence, found by jsg@ with afl. As a bonus, the new algorithm also reduces the code in the function by about 20%.
Diffstat (limited to 'term.c')
0 files changed, 0 insertions, 0 deletions