From kde-commits Thu Nov 24 14:47:45 2016 From: Kurt Hindenburg Date: Thu, 24 Nov 2016 14:47:45 +0000 To: kde-commits Subject: [konsole/Applications/16.12] src: Fix crash with combining characters after several cursorRight() ca Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147999888132261 Git commit 76453a7df8427048a8ce92169c3dbd172f89798c by Kurt Hindenburg, on = behalf of Martin T. H. Sandsmark. Committed on 24/11/2016 at 14:42. Pushed by hindenburg into branch 'Applications/16.12'. Fix crash with combining characters after several cursorRight() calls cursorRight() does not resize the _screenLines vector, leading to an assert in QVector when trying to look up the _cuX which is bigger than the amount of characters in the current line. BUG: 372530 (cherry picked from commit 80b9e0775ecc81a4462e932be7ffdb1e5b222a4d) M +1 -1 src/Screen.cpp https://commits.kde.org/konsole/76453a7df8427048a8ce92169c3dbd172f89798c diff --git a/src/Screen.cpp b/src/Screen.cpp index cc8daa3..d674017 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -640,7 +640,7 @@ void Screen::displayCharacter(unsigned short c) return; } // Find previous "real character" to try to combine with - int charToCombineWithX =3D _cuX; + int charToCombineWithX =3D qMin(_cuX, _screenLines[_cuY].length()); int charToCombineWithY =3D _cuY; do { if (charToCombineWithX > 0) {