changeset 24043:f50ef29d874e

Fix heap-buffer-overflow in GUI terminal code (51948). * TerminalView.cpp: Remove '+ 1' from terminal line count as the memory allocated for terminal previously is the *exact* number of lines. Classic off-by-1 error.
author Rik <rik@octave.org>
date Thu, 14 Sep 2017 09:02:07 -0700
parents 840882c82e22
children 76d90f0c81af
files libgui/qterminal/libqterminal/unix/TerminalView.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Thu Sep 14 10:36:37 2017 -0400
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Thu Sep 14 09:02:07 2017 -0700
@@ -833,7 +833,7 @@
   _screenWindow->resetScrollCount();
 
   Character* const newimg = _screenWindow->getImage();
-  int lines = _screenWindow->windowLines() + 1;
+  int lines = _screenWindow->windowLines();
   int columns = _screenWindow->windowColumns();
 
   setScroll( _screenWindow->currentLine() , _screenWindow->lineCount() );