[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1038390: bookworm-pu: package vte2.91/0.70.6-1~deb12u1



Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian.org@packages.debian.org
Usertags: pu
X-Debbugs-Cc: vte2.91@packages.debian.org, debian-boot@lists.debian.org, team@security.debian.org
Control: affects -1 + src:vte2.91

[ Reason ]
Fix an infinite-loop bug processing a particular control sequence.
(#1037919, LP: #2022019)

[ Impact ]
If unfixed, the infinite loop could be triggered by a malicious program
accessed via ssh, telnet or similar protocols and used as a denial of
service. I asked the security team whether they wanted to do a DSA for
this and haven't heard back, so I'm assuming the answer is no.

I would like to take the opportunity to integrate the rest of the upstream
bug-fix releases 0.70.4 and 0.70.5, which fix a few other bugs:

- an invalid memory access which can cause a terminal freeze
  or crash, for example when pasting emojis (vte#2606, vte#2620 upstream)
- seconds vs milliseconds confusion that meant the cursor didn't stop
  blinking as intended when a focused window becomes idle
  (vte#2622 upstream)
- correct coordinates when mouse wheel scrolling on the left edge of a
  terminal (vte#2621 upstream)

[ Tests ]
I reproduced #1037919 in bookworm's gnome-terminal and confirmed that
the proposed version fixes it. I haven't attempted to reproduce the other
fixed bugs.

The proposed version is functionally equivalent to the version in
unstable, which hasn't had any regression reports and should migrate
to testing soon. I'm using that version for day-to-day development, via
gnome-console.

A release-candidate of the bookworm package is available from:

    deb [trusted=yes] https://people.debian.org/~smcv/12.1 bookworm-proposed main

This is intentionally versioned slightly lower, but the changelog/version
number is the only difference.

[ Risks ]
It's a key package, but the changes are all straightforward, targeted
backports from newer upstream branches. 0.70.x is an upstream stable-branch
as part of GNOME 43.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
src/fonts-pangocairo.cc: vte#2606, vte#2620
src/vte.cc (last hunk): vte#2621
src/vteseq.cc: #1037919
The rest: vte#2622

[ Other info ]
Technically it has a udeb, so technically it needs a d-i ack; but it
isn't actually used in d-i, so that should just be a formality.
src:vte2.91 is for GTK 3 and 4, but the graphical installer is still
on GTK 2 and therefore uses the old src:vte instead.

Thanks,
    smcv
diffstat for vte2.91-0.70.3 vte2.91-0.70.6

 ChangeLog                                                                      |  115 +++++++++-
 debian/changelog                                                               |   50 ++++
 debian/control                                                                 |    2 
 debian/control.in                                                              |    2 
 debian/gbp.conf                                                                |    4 
 debian/patches/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch |    2 
 debian/watch                                                                   |    2 
 meson.build                                                                    |    2 
 src/fonts-pangocairo.cc                                                        |   20 +
 src/vte.cc                                                                     |   32 +-
 src/vteinternal.hh                                                             |   12 -
 src/vteseq.cc                                                                  |    4 
 src/widget.cc                                                                  |   12 -
 13 files changed, 217 insertions(+), 42 deletions(-)

diff -Nru vte2.91-0.70.3/ChangeLog vte2.91-0.70.6/ChangeLog
--- vte2.91-0.70.3/ChangeLog	2023-02-15 13:51:19.389171000 +0000
+++ vte2.91-0.70.6/ChangeLog	2023-06-14 11:43:45.178924600 +0100
@@ -1,4 +1,117 @@
-commit 177c96f2b7e58ba90a7b5738089e8a97094c84d5 (HEAD -> vte-0-70, tag: 0.70.3)
+commit 2654a3f26fc92870bfd65c028d0020432dd6e56e (HEAD -> vte-0-70, tag: 0.70.6)
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Thu Jun 1 21:30:48 2023 +0200
+
+    emulation: Fix infinite loop on non-number OSC 104 param
+    
+    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2631
+    (cherry picked from commit dce7b5f044b0f9e184f186315c846489a20edf0d)
+
+ src/vteseq.cc | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit b0f11e5bb60187fb3b1a51fdddbe7fe7f1a9507a
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Thu Apr 20 22:38:36 2023 +0200
+
+    build: Post release version bump
+
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 84e3d29a132721f78dfe96a728db11730d7a3e21 (tag: 0.70.5)
+Author: Eric Johnson <yut23@gvljohnsons.com>
+Date:   Wed Apr 5 19:17:06 2023 +0200
+
+    emulation: Fix invalid mouse scroll event on window edge
+    
+    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2621
+    (cherry picked from commit 19acc51708d9e75ef2b314aa026467570e0bd8ee)
+    (cherry picked from commit 3960fee241f39af6aeeff008a07796854e9b51f7)
+
+ src/vte.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit aa024f25245d7c7810bc4404e7aa2046486d229d
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Wed Apr 5 19:17:06 2023 +0200
+
+    widget: Fix cursor blink timeout
+    
+    Fix s/ms confusion to make the cursor stop blinking correctly.
+    
+    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2622
+    (cherry picked from commit 4da9d055f68f5b5dad9946b289a1836bd7c0fe8d)
+    (cherry picked from commit c4e8371fe65fdb3ea4c81c838d8373444e6d3400)
+
+ src/vte.cc         | 30 ++++++++++++++++--------------
+ src/vteinternal.hh | 12 ++++++------
+ src/widget.cc      | 12 ++++++------
+ 3 files changed, 28 insertions(+), 26 deletions(-)
+
+commit e7f8f858536b3beee5515caa96b9f2d9714f22bb
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Mon Mar 20 19:00:20 2023 +0100
+
+    build: Post release version bump
+
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c851dda5b459bc1d1d186c1134c8303be6e2a9f4 (tag: 0.70.4)
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Sat Mar 11 11:26:15 2023 +0100
+
+    fonts: Keep the PangoLayout unchanged
+    
+    The previous commit still wasn't completely fixing the problem, since
+    the FontInfo and the UnistrInfo are cached too, and m_layout will be
+    re-used when creating the next UnistrInfo, but the code in
+    pango_cairo_show_layout_line() requires the PangoLayout to still have
+    the same text as when it was created for the UnistrInfo.
+    
+    To fix this, adopt the PangoLayout into the PangoLayoutLine cached in
+    the UnistrInfo, and create a new layout for next use.
+    
+    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2606
+    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2620
+    (cherry picked from commit 3c8f66be867aca6656e4109ce880b6ea7431b895)
+    (cherry picked from commit 164c0f1eb5165786e0addfe5317cf6de3061ddf9)
+
+ src/fonts-pangocairo.cc | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+commit d02c5fce7d828c2c543d9ec01e36f4d6f97547ce
+Author: Christian Hergert <chergert@redhat.com>
+Date:   Sat Mar 11 11:26:15 2023 +0100
+
+    fonts: keep layout text available for cairo
+    
+    When a cairo recording surface is used, it will memcpy() the text and
+    therefore expects the layout's text to be complete enough to contain each
+    glyph item's offset from base pointer.
+    
+    This keeps that text around long enough to satisfy that requirement. It
+    will be reset on the next operation/call to get_unistr_info().
+    
+    Fixes #2620
+    
+    (cherry picked from commit 22b3a562d5c95f5911560131c9f6f2df70881e34)
+    (cherry picked from commit 0dc3dbae6cf71ee3f0efb1f31b8fd3eda7c150dd)
+
+ src/fonts-pangocairo.cc | 11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+commit 26c3d4a7dd9b0cdbd2ebfc4ff28b06c987cc8c29
+Author: Christian Persch <chpe@src.gnome.org>
+Date:   Sat Feb 11 19:20:53 2023 +0100
+
+    build: Post release version bump
+
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 177c96f2b7e58ba90a7b5738089e8a97094c84d5 (tag: 0.70.3)
 Author: Christian Persch <chpe@src.gnome.org>
 Date:   Sat Feb 11 19:05:48 2023 +0100
 
diff -Nru vte2.91-0.70.3/debian/changelog vte2.91-0.70.6/debian/changelog
--- vte2.91-0.70.3/debian/changelog	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/changelog	2023-06-14 12:17:06.000000000 +0100
@@ -1,3 +1,53 @@
+vte2.91 (0.70.6-1~deb12u1) bookworm; urgency=medium
+
+  * Team upload
+  * Rebuild for bookworm (Closes: #1037919, LP: #2022019)
+  * d/gbp.conf, d/control.in: Use debian/bookworm packaging branch
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 14 Jun 2023 12:17:06 +0100
+
+vte2.91 (0.70.6-1) unstable; urgency=medium
+
+  * Team upload
+  * New upstream release
+    - Functionally equivalent to 0.70.5-2, but the fix for #1037919
+      is incorporated upstream instead of as a patch
+  * Add Debian and Ubuntu bug numbers to 0.70.5-2 changelog entry
+  * Fix a typo in revised 0.70.5-1 changelog entry
+  * d/gbp.conf, d/control.in: Use debian/trixie branch for packaging
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 14 Jun 2023 12:16:35 +0100
+
+vte2.91 (0.70.5-2) unstable; urgency=high
+
+  * Team upload
+  * This version is functionally equivalent to 0.70.6 upstream, but 0.70.6
+    tarballs are not yet available
+  * d/p/emulation-Fix-infinite-loop-on-non-number-OSC-104-param.patch:
+    Add patch from upstream to fix an infinite loop processing OSC 104.
+    A malicious program accessed via ssh, telnet or similar protocols could
+    use this as a denial of service.
+    (Closes: #1037919, LP: #2022019; vte#2631 upstream)
+  * Add more details of the bugs fixed in the previous changelog entry
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 14 Jun 2023 10:17:06 +0100
+
+vte2.91 (0.70.5-1) unstable; urgency=medium
+
+  * New upstream bugfix release 0.70.4
+    - Fix an invalid memory access which can cause a terminal freeze
+      or crash, for example when pasting emojis
+      (vte#2606, vte#2620 upstream)
+  * New upstream bugfix release 0.70.5
+    - Fix seconds vs milliseconds confusion so that the cursor stops
+      blinking as intended when a focused window becomes idle
+      (vte#2622 upstream)
+    - Produce correct coordinates when mouse wheel scrolling on the
+      left edge of a terminal (vte#2621 upstream)
+  * d/gbp.conf, d/watch: Branch for 0.70.x and bookworm
+
+ -- Jeremy Bícha <jbicha@ubuntu.com>  Mon, 29 May 2023 17:19:45 -0400
+
 vte2.91 (0.70.3-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru vte2.91-0.70.3/debian/control vte2.91-0.70.6/debian/control
--- vte2.91-0.70.3/debian/control	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/control	2023-06-14 12:17:06.000000000 +0100
@@ -29,7 +29,7 @@
                      libgtk-3-doc <!nodoc>
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/gnome-team/vte2.91
-Vcs-Git: https://salsa.debian.org/gnome-team/vte2.91.git
+Vcs-Git: https://salsa.debian.org/gnome-team/vte2.91.git -b debian/bookworm
 Homepage: https://wiki.gnome.org/Apps/Terminal/VTE
 
 Package: libvte-2.91-0
diff -Nru vte2.91-0.70.3/debian/control.in vte2.91-0.70.6/debian/control.in
--- vte2.91-0.70.3/debian/control.in	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/control.in	2023-06-14 12:17:06.000000000 +0100
@@ -25,7 +25,7 @@
                      libgtk-3-doc <!nodoc>
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/gnome-team/vte2.91
-Vcs-Git: https://salsa.debian.org/gnome-team/vte2.91.git
+Vcs-Git: https://salsa.debian.org/gnome-team/vte2.91.git -b debian/bookworm
 Homepage: https://wiki.gnome.org/Apps/Terminal/VTE
 
 Package: libvte-2.91-0
diff -Nru vte2.91-0.70.3/debian/gbp.conf vte2.91-0.70.6/debian/gbp.conf
--- vte2.91-0.70.3/debian/gbp.conf	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/gbp.conf	2023-06-14 12:17:06.000000000 +0100
@@ -1,7 +1,7 @@
 [DEFAULT]
 pristine-tar = True
-debian-branch = debian/master
-upstream-branch = upstream/latest
+debian-branch = debian/bookworm
+upstream-branch = upstream/0.70.x
 
 [buildpackage]
 sign-tags = True
diff -Nru vte2.91-0.70.3/debian/patches/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch vte2.91-0.70.6/debian/patches/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch
--- vte2.91-0.70.3/debian/patches/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/patches/Allow-background-color-and-color-on-VteTerminal-widgets-t.patch	2023-06-14 12:17:06.000000000 +0100
@@ -13,7 +13,7 @@
  1 file changed, 22 insertions(+), 6 deletions(-)
 
 diff --git a/src/vtegtk.cc b/src/vtegtk.cc
-index 3945ba6..899592f 100644
+index 591c127..87375f3 100644
 --- a/src/vtegtk.cc
 +++ b/src/vtegtk.cc
 @@ -92,6 +92,7 @@ template<typename T>
diff -Nru vte2.91-0.70.3/debian/watch vte2.91-0.70.6/debian/watch
--- vte2.91-0.70.3/debian/watch	2023-02-15 14:51:14.000000000 +0000
+++ vte2.91-0.70.6/debian/watch	2023-06-14 12:17:06.000000000 +0100
@@ -1,6 +1,6 @@
 version=4
 opts="searchmode=plain, uversionmangle=s/\.(alpha|beta|rc)/~$1/, downloadurlmangle=s|cache.json||" \
 https://download.gnome.org/sources/vte/cache.json \
-	[\d.]+[02468]/vte-([\d.]+)@ARCHIVE_EXT@
+	0.70/vte-([\d.]+)@ARCHIVE_EXT@
 #opts=filenamemangle=s/.*\///g \
 #  https://gitlab.gnome.org/GNOME/vte/tags?sort=updated_desc .*/archive/(\d+\.\d*[02468]\.\S+)/vte-\1\.tar\.gz
diff -Nru vte2.91-0.70.3/meson.build vte2.91-0.70.6/meson.build
--- vte2.91-0.70.3/meson.build	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/meson.build	2023-06-01 20:34:34.000000000 +0100
@@ -17,7 +17,7 @@
 project(
   'vte',
   ['c', 'cpp'],
-  version: '0.70.3',
+  version: '0.70.6',
   license: ['LGPL-3.0-or-later', 'GPL-3.0-or-later'],
   default_options: [
     'buildtype=release',
diff -Nru vte2.91-0.70.3/src/fonts-pangocairo.cc vte2.91-0.70.6/src/fonts-pangocairo.cc
--- vte2.91-0.70.3/src/fonts-pangocairo.cc	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/src/fonts-pangocairo.cc	2023-06-01 20:34:34.000000000 +0100
@@ -452,11 +452,20 @@
 	{
 		uinfo->set_coverage(UnistrInfo::Coverage::USE_PANGO_LAYOUT_LINE);
 
+                // When using a cairo surface which uses show_text_glyphs,
+                // pango_cairo_show_layout_line() will use the text from
+                // @line->layout and it must be the text that was used when
+                // the PangoLayoutLine was created.  Also, since @line was
+                // obtained from m_layout, when setting m_layout to a new
+                // text later this will change @line->layout to %NULL.
+                // To make this work, we instead adopt the @m_layout instance
+                // into @line->layout, and create a new @m_layout object.
+
+                line->layout = m_layout.release(); // adopted
 		ufi->using_pango_layout_line.line = pango_layout_line_ref (line);
-		/* we hold a manual reference on layout.  pango currently
-		 * doesn't work if line->layout is NULL.  ugh! */
-		pango_layout_set_text(m_layout.get(), "", -1); /* make layout disassociate from the line */
-		ufi->using_pango_layout_line.line->layout = (PangoLayout *)g_object_ref(m_layout.get());
+
+                auto const context = pango_layout_get_context(line->layout);
+                m_layout = vte::glib::take_ref(pango_layout_new(context));
 
 	} else {
 		PangoGlyphItem *glyph_item = (PangoGlyphItem *)line->runs->data;
@@ -489,8 +498,7 @@
 		}
 	}
 
-	/* release internal layout resources */
-	pango_layout_set_text(m_layout.get(), "", -1);
+        // Don't reset m_layout here; it'll get reset anyway when we next use it.
 
 #ifdef VTE_DEBUG
 	m_coverage_count[0]++;
diff -Nru vte2.91-0.70.3/src/vte.cc vte2.91-0.70.6/src/vte.cc
--- vte2.91-0.70.3/src/vte.cc	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/src/vte.cc	2023-06-01 20:34:34.000000000 +0100
@@ -840,19 +840,20 @@
 Terminal::cursor_blink_timer_callback()
 {
 	m_cursor_blink_state = !m_cursor_blink_state;
-	m_cursor_blink_time += m_cursor_blink_cycle;
+	m_cursor_blink_time_ms += m_cursor_blink_cycle_ms;
 
 	invalidate_cursor_once(true);
 
 	/* only disable the blink if the cursor is currently shown.
 	 * else, wait until next time.
 	 */
-	if (m_cursor_blink_time / 1000 >= m_cursor_blink_timeout &&
+	if (m_cursor_blink_time_ms >= m_cursor_blink_timeout_ms &&
 	    m_cursor_blink_state) {
 		return false;
         }
 
-        m_cursor_blink_timer.schedule(m_cursor_blink_cycle, vte::glib::Timer::Priority::eLOW);
+        m_cursor_blink_timer.schedule(m_cursor_blink_cycle_ms,
+                                      vte::glib::Timer::Priority::eLOW);
         return false;
 }
 
@@ -4471,8 +4472,9 @@
 	if (m_cursor_blink_timer)
 		return; /* already added */
 
-	m_cursor_blink_time = 0;
-        m_cursor_blink_timer.schedule(m_cursor_blink_cycle, vte::glib::Timer::Priority::eLOW);
+	m_cursor_blink_time_ms = 0;
+        m_cursor_blink_timer.schedule(m_cursor_blink_cycle_ms,
+                                      vte::glib::Timer::Priority::eLOW);
 }
 
 void
@@ -7891,17 +7893,17 @@
 
 void
 Terminal::set_blink_settings(bool blink,
-                             int blink_time,
-                             int blink_timeout) noexcept
+                             int blink_time_ms,
+                             int blink_timeout_ms) noexcept
 {
         m_cursor_blinks = m_cursor_blinks_system = blink;
-        m_cursor_blink_cycle = std::max(blink_time / 2, VTE_MIN_CURSOR_BLINK_CYCLE);
-        m_cursor_blink_timeout = std::max(blink_timeout, VTE_MIN_CURSOR_BLINK_TIMEOUT);
+        m_cursor_blink_cycle_ms = std::max(blink_time_ms / 2, VTE_MIN_CURSOR_BLINK_CYCLE);
+        m_cursor_blink_timeout_ms = std::max(blink_timeout_ms, VTE_MIN_CURSOR_BLINK_TIMEOUT);
 
         update_cursor_blinks();
 
         /* Misuse gtk-cursor-blink-time for text blinking as well. This might change in the future. */
-        m_text_blink_cycle = m_cursor_blink_cycle;
+        m_text_blink_cycle_ms = m_cursor_blink_cycle_ms;
         if (m_text_blink_timer) {
                 /* The current phase might have changed, and an already installed
                  * timer to blink might fire too late. So remove the timer and
@@ -9237,7 +9239,7 @@
         int allocated_width, allocated_height;
         int extra_area_for_cursor;
         bool text_blink_enabled_now;
-        gint64 now = 0;
+        auto now_ms = int64_t{0};
 
         allocated_width = get_allocated_width();
         allocated_height = get_allocated_height();
@@ -9283,8 +9285,8 @@
         m_text_blink_state = true;
         text_blink_enabled_now = (unsigned)m_text_blink_mode & (unsigned)(m_has_focus ? TextBlinkMode::eFOCUSED : TextBlinkMode::eUNFOCUSED);
         if (text_blink_enabled_now) {
-                now = g_get_monotonic_time() / 1000;
-                if (now % (m_text_blink_cycle * 2) >= m_text_blink_cycle)
+                now_ms = g_get_monotonic_time() / 1000;
+                if (now_ms % (m_text_blink_cycle_ms * 2) >= m_text_blink_cycle_ms)
                         m_text_blink_state = false;
         }
         /* Painting will flip this if it encounters any cell with blink attribute */
@@ -9335,7 +9337,7 @@
          * implicitly by the timer not getting reinstalled anymore (often after a final unnecessary but
          * harmless repaint). */
         if (G_UNLIKELY (m_text_to_blink && text_blink_enabled_now && !m_text_blink_timer))
-                m_text_blink_timer.schedule(m_text_blink_cycle - now % m_text_blink_cycle,
+                m_text_blink_timer.schedule(m_text_blink_cycle_ms - now_ms % m_text_blink_cycle_ms,
                                             vte::glib::Timer::Priority::eLOW);
 
         m_invalidated_all = FALSE;
@@ -9407,7 +9409,7 @@
 			cnt = -cnt;
 		for (i = 0; i < cnt; i++) {
 			/* Encode the parameters and send them to the app. */
-                        feed_mouse_event(grid_coords_from_view_coords(m_mouse_last_position),
+                        feed_mouse_event(confined_grid_coords_from_view_coords(m_mouse_last_position),
                                          button,
                                          false /* not drag */,
                                          false /* not release */);
diff -Nru vte2.91-0.70.3/src/vteinternal.hh vte2.91-0.70.6/src/vteinternal.hh
--- vte2.91-0.70.3/src/vteinternal.hh	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/src/vteinternal.hh	2023-06-01 20:34:34.000000000 +0100
@@ -462,9 +462,9 @@
         bool m_cursor_blink_state{false};
         bool m_cursor_blinks{false};        /* whether the cursor is actually blinking */
         bool m_cursor_blinks_system{true};  /* gtk-cursor-blink */
-        gint m_cursor_blink_cycle{1000};    /* gtk-cursor-blink-time / 2 */
-        int m_cursor_blink_timeout{500};    /* gtk-cursor-blink-timeout */
-        gint64 m_cursor_blink_time;         /* how long the cursor has been blinking yet */
+        int m_cursor_blink_cycle_ms{1000};  /* gtk-cursor-blink-time / 2 */
+        int m_cursor_blink_timeout_ms{500}; /* gtk-cursor-blink-timeout */
+        int64_t m_cursor_blink_time_ms;     /* how long the cursor has been blinking yet */
         bool m_has_focus{false};            /* is the widget focused */
 
         /* Contents blinking */
@@ -475,7 +475,7 @@
         bool m_text_blink_state{false};  /* whether blinking text should be visible at this very moment */
         bool m_text_to_blink{false};     /* drawing signals here if it encounters any cell with blink attribute */
         TextBlinkMode m_text_blink_mode{TextBlinkMode::eALWAYS};
-        gint m_text_blink_cycle;  /* gtk-cursor-blink-time / 2 */
+        int m_text_blink_cycle_ms;  /* gtk-cursor-blink-time / 2 */
 
         /* DECSCUSR cursor style (shape and blinking possibly overridden
          * via escape sequence) */
@@ -922,8 +922,8 @@
 #endif /* VTE_GTK */
 
         void set_blink_settings(bool blink,
-                                int blink_time,
-                                int blink_timeout) noexcept;
+                                int blink_time_ms,
+                                int blink_timeout_ms) noexcept;
 
         void draw(cairo_t *cr,
                   cairo_region_t const* region) noexcept;
diff -Nru vte2.91-0.70.3/src/vteseq.cc vte2.91-0.70.6/src/vteseq.cc
--- vte2.91-0.70.3/src/vteseq.cc	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/src/vteseq.cc	2023-06-01 20:34:34.000000000 +0100
@@ -1509,8 +1509,10 @@
 
         while (token != endtoken) {
                 int value;
-                if (!token.number(value))
+                if (!token.number(value)) {
+                        ++token;
                         continue;
+                }
 
                 int index;
                 if (get_osc_color_index(osc, value, index) &&
diff -Nru vte2.91-0.70.3/src/widget.cc vte2.91-0.70.6/src/widget.cc
--- vte2.91-0.70.3/src/widget.cc	2023-02-11 18:20:05.000000000 +0000
+++ vte2.91-0.70.6/src/widget.cc	2023-06-01 20:34:34.000000000 +0100
@@ -1861,15 +1861,15 @@
 Widget::settings_changed()
 {
         auto blink = gboolean{};
-        auto blink_time = int{};
-        auto blink_timeout = int{};
+        auto blink_time_ms = int{};
+        auto blink_timeout_s = int{};
 #if VTE_GTK == 4
         auto aspect = double{};
 #endif
         g_object_get(m_settings.get(),
                      "gtk-cursor-blink", &blink,
-                     "gtk-cursor-blink-time", &blink_time,
-                     "gtk-cursor-blink-timeout", &blink_timeout,
+                     "gtk-cursor-blink-time", &blink_time_ms,
+                     "gtk-cursor-blink-timeout", &blink_timeout_s,
 #if VTE_GTK == 4
                      "gtk-cursor-aspect-ratio", &aspect,
 #endif
@@ -1877,9 +1877,9 @@
 
         _vte_debug_print(VTE_DEBUG_MISC,
                          "Cursor blinking settings: blink=%d time=%d timeout=%d\n",
-                         blink, blink_time, blink_timeout);
+                         blink, blink_time_ms, blink_timeout_s * 1000);
 
-        m_terminal->set_blink_settings(blink, blink_time, blink_timeout);
+        m_terminal->set_blink_settings(blink, blink_time_ms, blink_timeout_s * 1000);
 
 #if VTE_GTK == 4
         m_terminal->set_cursor_aspect(aspect);

Reply to: