diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-08-18 21:07:53 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-08-18 21:07:53 +0000 |
commit | a76386cba793369342a8bb5bb809d74d6158d938 (patch) | |
tree | d19e8d9489c57f0d8a119a303b40fcb7daa14066 | |
parent | 4720797aad300924396f0e81ac41b4aaf9863dea (diff) | |
download | mandoc-a76386cba793369342a8bb5bb809d74d6158d938.tar.gz |
Control reading off the edge of our buffer in term_flushln().
This happens in specific conditions (trailing whitespace in certain
terminal modes), but in practise, it happens quite often (as reported by
valgrind).
In short, "Nothing about term_flushln() is simple. Srsly!" (schwarze@)
Discussed on tech@, ok schwarze@.
-rw-r--r-- | term.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -220,7 +220,7 @@ term_flushln(struct termp *p) break; if (' ' == p->buf[i]) { j = i; - while (' ' == p->buf[i]) + while (i < p->col && ' ' == p->buf[i]) i++; dv = (i - j) * (*p->width)(p, ' '); vbl += dv; |