summaryrefslogtreecommitdiffstats
path: root/sys/teken
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-12-05 10:15:23 +0000
committered <ed@FreeBSD.org>2010-12-05 10:15:23 +0000
commitfb1c48789ea475d4f325412db997363968b23e92 (patch)
tree7800ae6521ab1c6fe36b86d915b6ccfe654248d2 /sys/teken
parent1fc00c1bd7e0da3183e7e3bbede72568201b7cbe (diff)
downloadFreeBSD-src-fb1c48789ea475d4f325412db997363968b23e92.zip
FreeBSD-src-fb1c48789ea475d4f325412db997363968b23e92.tar.gz
Use proper bounds checking on VPA.
We must check against tp->t_cursor.tp_row, not row, to figure out whether we must clamp the cursor position. Submitted by: luigi MFC after: 3 weeks
Diffstat (limited to 'sys/teken')
-rw-r--r--sys/teken/teken_subr.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h
index c84679a..2934bcc 100644
--- a/sys/teken/teken_subr.h
+++ b/sys/teken/teken_subr.h
@@ -1299,10 +1299,9 @@ teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
{
t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1;
- if (row >= t->t_originreg.ts_end)
+ if (t->t_cursor.tp_row >= t->t_originreg.ts_end)
t->t_cursor.tp_row = t->t_originreg.ts_end - 1;
-
t->t_stateflags &= ~TS_WRAPPED;
teken_funcs_cursor(t);
}
OpenPOWER on IntegriCloud