diff --git a/SOURCES/0001-Increment-the-lines-counter-when-skipping-a-line-to-.patch b/SOURCES/0001-Increment-the-lines-counter-when-skipping-a-line-to-.patch new file mode 100644 index 0000000..12fede0 --- /dev/null +++ b/SOURCES/0001-Increment-the-lines-counter-when-skipping-a-line-to-.patch @@ -0,0 +1,39 @@ +From 66a2bbfc0252bc61b214749e3b56f2cfacc652a7 Mon Sep 17 00:00:00 2001 +From: Nicholas Marriott +Date: Tue, 4 Apr 2023 13:24:56 -0400 +Subject: [PATCH] Increment the lines counter when skipping a line to avoid an + infinite + +loop, and fix a check to avoid a potential out-of-bounds access. Problem +reported by Yuxiang Qin and tracked down by Karl Beldan; GitHub issue +1352. + +Backport ba31d3a to 2.7 +--- + grid.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grid.c b/grid.c +index e4ba7df4..4db4c693 100644 +--- a/grid.c ++++ b/grid.c +@@ -1010,7 +1010,7 @@ grid_reflow_join(struct grid *target, struct grid *gd, u_int sx, u_int yy, + * If this is now the last line, there is nothing more to be + * done. + */ +- if (yy + lines == gd->hsize + gd->sy) ++ if (yy + 1 + lines == gd->hsize + gd->sy) + break; + line = yy + 1 + lines; + +@@ -1020,6 +1020,7 @@ grid_reflow_join(struct grid *target, struct grid *gd, u_int sx, u_int yy, + if (gd->linedata[line].cellused == 0) { + if (!wrapped) + break; ++ lines++; + continue; + } + +-- +2.31.1 + diff --git a/SPECS/tmux.spec b/SPECS/tmux.spec index cd2a9f8..df114f9 100644 --- a/SPECS/tmux.spec +++ b/SPECS/tmux.spec @@ -2,7 +2,7 @@ Name: tmux Version: 2.7 -Release: 1%{?dist} +Release: 3%{?dist} Summary: A terminal multiplexer Group: Applications/System @@ -13,6 +13,7 @@ URL: https://tmux.github.io/ Source0: https://github.com/tmux/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz # Examples has been removed - so include the bash_completion here Source1: bash_completion_tmux.sh +Patch1: 0001-Increment-the-lines-counter-when-skipping-a-line-to-.patch BuildRequires: gcc BuildRequires: ncurses-devel @@ -64,6 +65,10 @@ fi %{_datadir}/bash-completion/completions/tmux %changelog +* Tue Apr 04 2023 Josh Boyer - 2.7-3 +- Backport fix for intermittent stalling bug + Resolves: rhbz 2024339 + * Thu Apr 19 2018 Filipe Rosset - 2.7-1 - update to version 2.7, fixes rhbz #1486507 - removed upstreamed patches + spec modernization