Out-of-bounds fix for FMouse

This commit is contained in:
Markus Gans 2018-10-11 11:40:28 +02:00
parent fea78841b9
commit dbaebf0efc
1 changed files with 2 additions and 2 deletions

View File

@ -700,7 +700,7 @@ void FMouseSGR::setRawData (FKeyboard::keybuffer& fifo_buf)
std::size_t len = std::strlen(fifo_buf);
std::size_t n = 3;
while ( n < len && n < fifo_buf_size )
while ( n < len && n < MOUSE_BUF_SIZE + 3 )
{
sgr_mouse[n - 3] = fifo_buf[n];
n++;
@ -954,7 +954,7 @@ void FMouseUrxvt::setRawData (FKeyboard::keybuffer& fifo_buf)
std::size_t len = std::strlen(fifo_buf);
std::size_t n = 2;
while ( n < len && n < fifo_buf_size )
while ( n < len && n < MOUSE_BUF_SIZE + 2 )
{
urxvt_mouse[n - 2] = fifo_buf[n];
n++;