From 09b6f35fe97dff9e1643fa356b5b8692280afdee Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Oct 04 2019 14:27:08 +0000 Subject: Backport fix for crash due to out of bounds cursor (#1756567) --- diff --git a/0001-emulation-Ensure-the-cursor-remains-onscreen-when-mo.patch b/0001-emulation-Ensure-the-cursor-remains-onscreen-when-mo.patch new file mode 100644 index 0000000..5f2a20f --- /dev/null +++ b/0001-emulation-Ensure-the-cursor-remains-onscreen-when-mo.patch @@ -0,0 +1,35 @@ +From ef0734c1eb775cf98db9a6e8e87700830b1a3890 Mon Sep 17 00:00:00 2001 +From: Egmont Koblinger +Date: Tue, 24 Sep 2019 13:01:54 +0200 +Subject: [PATCH] emulation: Ensure the cursor remains onscreen when moving + down + +Previously the cursor could escape from the onscreen area, resulting in +a crash. This happened when a scrolling area was defined which did not +include the bottom row, the cursor was in the terminal's bottom row and +moved downwards from there. + +https://gitlab.gnome.org/GNOME/vte/issues/176 +--- + src/vte.cc | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/vte.cc b/src/vte.cc +index 1f926511..45d480c8 100644 +--- a/src/vte.cc ++++ b/src/vte.cc +@@ -2706,8 +2706,9 @@ Terminal::cursor_down(bool explicit_sequence) + VteRowData *rowdata = ensure_row(); + _vte_row_data_fill (rowdata, &m_color_defaults, m_column_count); + } +- } else { +- /* Otherwise, just move the cursor down. */ ++ } else if (m_screen->cursor.row < m_screen->insert_delta + m_row_count - 1) { ++ /* Otherwise, just move the cursor down; unless it's already in the last ++ * physical row (which is possible with scrolling region, see #176). */ + m_screen->cursor.row++; + } + } +-- +2.23.0 + diff --git a/vte291.spec b/vte291.spec index ba44d68..080b1d5 100644 --- a/vte291.spec +++ b/vte291.spec @@ -9,7 +9,7 @@ Name: vte291 Version: 0.58.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Terminal emulator library License: LGPLv2+ @@ -19,6 +19,10 @@ Source0: http://download.gnome.org/sources/vte/0.58/vte-%{version}.tar.xz # https://bugzilla.gnome.org/show_bug.cgi?id=711059 # https://bugzilla.redhat.com/show_bug.cgi?id=1103380 Patch100: vte291-cntnr-precmd-preexec-scroll.patch +# Backport fix for crash due to out of bounds cursor position +# https://bugzilla.redhat.com/show_bug.cgi?id=1756567 +# https://gitlab.gnome.org/GNOME/vte/issues/176 +Patch101: 0001-emulation-Ensure-the-cursor-remains-onscreen-when-mo.patch BuildRequires: gcc-c++ BuildRequires: gettext @@ -76,6 +80,7 @@ emulator library. %prep %setup -q -n vte-%{version} %patch100 -p1 -b .cntnr-precmd-preexec-scroll +%patch101 -p1 -b .cursor-crash %build %meson --buildtype=plain -Ddocs=true @@ -105,6 +110,9 @@ emulator library. %{_sysconfdir}/profile.d/vte.sh %changelog +* Fri Oct 04 2019 Adam Williamson - 0.58.0-2 +- Backport fix for crash due to out of bounds cursor position (#1756567) + * Mon Sep 09 2019 Kalev Lember - 0.58.0-1 - Update to 0.58.0