From f93d2ea70d03ee67b7729fdb363e6815e33de3ef Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Fri, 7 Sep 2007 21:50:13 +0000 Subject: [PATCH] Fix another possible index-out-of-bounds when inserting characters. Fix terminal display image buffer overflow when rendering double-height lines. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=709594 --- src/Screen.cpp | 3 +++ src/TerminalDisplay.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Screen.cpp b/src/Screen.cpp index bb6068dab..8bd91aeeb 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -307,6 +307,9 @@ void Screen::insertChars(int n) { if (n == 0) n = 1; // Default + if ( screenLines[cuY].size() < cuX ) + screenLines[cuY].resize(cuX); + screenLines[cuY].insert(cuX,n,' '); if ( screenLines[cuY].count() > columns ) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index ca123106d..48296812b 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -1281,7 +1281,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect) //reset back to single-width, single-height _lines paint.resetMatrix(); - if (y < _lineProperties.size()) + if (y < _lineProperties.size()-1) { //double-height _lines are represented by two adjacent _lines //containing the same characters