mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
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
This commit is contained in:
parent
5c06c8a134
commit
9d67d2214f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216198
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user