diff options
author | Joe Wilm <joe@jwilm.com> | 2016-06-06 17:46:26 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-06-06 17:46:26 -0700 |
commit | 3d62c2b8f54a87353f8182b64ce29d4558083075 (patch) | |
tree | 7bb5da900a332b8bc743ef401823046dad10fcea | |
parent | 581eb6b69f93f1c1314032b836d4a40896270c28 (diff) | |
download | r-alacritty-3d62c2b8f54a87353f8182b64ce29d4558083075.tar.gz r-alacritty-3d62c2b8f54a87353f8182b64ce29d4558083075.tar.bz2 r-alacritty-3d62c2b8f54a87353f8182b64ce29d4558083075.zip |
Add explicit bounds check when advancing cursor
-rw-r--r-- | src/term.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/term.rs b/src/term.rs index b25502f1..c254f6b9 100644 --- a/src/term.rs +++ b/src/term.rs @@ -158,6 +158,10 @@ impl Term { self.cursor.x = 0; } + if self.cursor.y == self.grid.num_rows() as u16 { + panic!("cursor fell off grid"); + } + let cell = &mut self.grid[self.cursor]; cell.c = c; cell.fg = self.fg; |