Compare commits

..

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

2
.gitignore vendored

@ -1 +1 @@
SOURCES/tmux-3.2a.tar.gz
SOURCES/tmux-b202a2f1b517a3de7141fc35fbd9e39ed5ac5284.tar.gz

@ -1 +1 @@
519c08880307ef13c799cb6988b4fd11ec5c2b77 SOURCES/tmux-3.2a.tar.gz
cbb49e7964a549f65560dc9ae705c0af97279211 SOURCES/tmux-b202a2f1b517a3de7141fc35fbd9e39ed5ac5284.tar.gz

@ -1,122 +0,0 @@
From 369627faddc1bba283c6afc4d473d7a495edb9a7 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 07:38:21 -0400
Subject: [PATCH 01/12] Fix memory leaks Backport of upstream commits:
4a753dbefc2e67c218cf41141eaa6afab00f774a
3c65475561b25073c3b7dcbb0b6498a0535ecd59
a9ac61469175e45c8ba58ae0360306aa06c0cd59
72d905f32c53ea1304b4b3206383502a23cfc0fd
---
cmd-display-menu.c | 6 +++++-
cmd-source-file.c | 4 +++-
format.c | 4 ++--
key-bindings.c | 5 ++++-
popup.c | 1 +
5 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/cmd-display-menu.c b/cmd-display-menu.c
index de423e68..d61fedbb 100644
--- a/cmd-display-menu.c
+++ b/cmd-display-menu.c
@@ -248,6 +248,7 @@ cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item,
log_debug("%s: -y: %s = %s = %u", __func__, yp, p, *py);
free(p);
+ format_free(ft);
return (1);
}
@@ -391,7 +392,10 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
else if (args_has(args, 'E'))
flags |= POPUP_CLOSEEXIT;
if (popup_display(flags, item, px, py, w, h, shellcmd, argc, argv, cwd,
- tc, s, NULL, NULL) != 0)
+ tc, s, NULL, NULL) != 0) {
+ free(cwd);
return (CMD_RETURN_NORMAL);
+ }
+ free(cwd);
return (CMD_RETURN_WAIT);
}
diff --git a/cmd-source-file.c b/cmd-source-file.c
index c1eeba58..296c31f9 100644
--- a/cmd-source-file.c
+++ b/cmd-source-file.c
@@ -176,15 +176,17 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item)
cmdq_error(item, "%s: %s", path, error);
retval = CMD_RETURN_ERROR;
}
+ globfree(&g);
free(pattern);
continue;
}
- free(expand);
free(pattern);
for (j = 0; j < g.gl_pathc; j++)
cmd_source_file_add(cdata, g.gl_pathv[j]);
+ globfree(&g);
}
+ free(expand);
cdata->after = item;
cdata->retval = retval;
diff --git a/format.c b/format.c
index 512df009..673a6085 100644
--- a/format.c
+++ b/format.c
@@ -3382,12 +3382,12 @@ found:
}
if (modifiers & FORMAT_QUOTE_SHELL) {
saved = found;
- found = xstrdup(format_quote_shell(saved));
+ found = format_quote_shell(saved);
free(saved);
}
if (modifiers & FORMAT_QUOTE_STYLE) {
saved = found;
- found = xstrdup(format_quote_style(saved));
+ found = format_quote_style(saved);
free(saved);
}
return (found);
diff --git a/key-bindings.c b/key-bindings.c
index 467c7f93..4df0cddc 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -187,6 +187,7 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
{
struct key_table *table;
struct key_binding *bd;
+ char *s;
table = key_bindings_get_table(name, 1);
@@ -216,8 +217,10 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
bd->flags |= KEY_BINDING_REPEAT;
bd->cmdlist = cmdlist;
+ s = cmd_list_print(bd->cmdlist, 0);
log_debug("%s: %#llx %s = %s", __func__, bd->key,
- key_string_lookup_key(bd->key, 1), cmd_list_print(bd->cmdlist, 0));
+ key_string_lookup_key(bd->key, 1), s);
+ free(s);
}
void
diff --git a/popup.c b/popup.c
index 509d182d..a98cc42a 100644
--- a/popup.c
+++ b/popup.c
@@ -142,6 +142,7 @@ popup_draw_cb(struct client *c, __unused struct screen_redraw_ctx *ctx0)
tty_draw_line(tty, &s, 0, i, pd->sx, px, py + i,
&grid_default_cell, NULL);
}
+ screen_free(&s);
c->overlay_check = popup_check_cb;
}
--
2.31.1

@ -1,32 +0,0 @@
From b4ae1931b2170d783f9a946e6f1983e3d0976107 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 11:33:56 -0400
Subject: [PATCH 02/12] Close file stream on error
---
file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/file.c b/file.c
index 974c8a37..9368b4f4 100644
--- a/file.c
+++ b/file.c
@@ -391,6 +391,7 @@ file_read(struct client *c, const char *path, client_file_cb cb, void *cbdata)
size = fread(buffer, 1, sizeof buffer, f);
if (evbuffer_add(cf->buffer, buffer, size) != 0) {
cf->error = ENOMEM;
+ fclose(f);
goto done;
}
if (size != sizeof buffer)
@@ -398,6 +399,7 @@ file_read(struct client *c, const char *path, client_file_cb cb, void *cbdata)
}
if (ferror(f)) {
cf->error = EIO;
+ fclose(f);
goto done;
}
fclose(f);
--
2.31.1

@ -1,32 +0,0 @@
From 5e83beff72bed8f8e96fbfe63b7a814d34205354 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 11:54:51 -0400
Subject: [PATCH 03/12] Fix memory leak with time_format
---
format.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/format.c b/format.c
index 673a6085..01204b8a 100644
--- a/format.c
+++ b/format.c
@@ -4416,6 +4416,7 @@ done:
free(sub);
format_free_modifiers(list, count);
free(copy0);
+ free(time_format);
return (0);
fail:
@@ -4424,6 +4425,7 @@ fail:
free(sub);
format_free_modifiers(list, count);
free(copy0);
+ free(time_format);
return (-1);
}
--
2.31.1

@ -1,33 +0,0 @@
From 777edc3d865ac52837072da904748a6f70d36b8b Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 12:22:06 -0400
Subject: [PATCH 04/12] Fix memory leak with condition on error path
---
format.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/format.c b/format.c
index 01204b8a..6f057b5e 100644
--- a/format.c
+++ b/format.c
@@ -4019,7 +4019,7 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen,
struct window_pane *wp = ft->wp;
const char *errstr, *copy, *cp, *marker = NULL;
const char *time_format = NULL;
- char *copy0, *condition, *found, *new;
+ char *copy0, *condition = NULL, *found, *new;
char *value, *left, *right, c;
size_t valuelen;
int modifiers = 0, limit = 0, width = 0;
@@ -4425,6 +4425,7 @@ fail:
free(sub);
format_free_modifiers(list, count);
free(copy0);
+ free(condition);
free(time_format);
return (-1);
}
--
2.31.1

@ -1,24 +0,0 @@
From 47d2223dd090b365246709f9c20ce8684259590e Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 12:36:06 -0400
Subject: [PATCH 05/12] Free s even if there is no expanded format
---
menu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/menu.c b/menu.c
index 48c9ed2f..137c8c8d 100644
--- a/menu.c
+++ b/menu.c
@@ -78,6 +78,7 @@ menu_add_item(struct menu *menu, const struct menu_item *item,
s = format_single(qitem, item->name, c, NULL, NULL, NULL);
if (*s == '\0') { /* no item if empty after format expanded */
menu->count--;
+ free(s);
return;
}
if (*s != '-' && item->key != KEYC_UNKNOWN && item->key != KEYC_NONE) {
--
2.31.1

@ -1,32 +0,0 @@
From 8a6f2d39bf883a05145651e04ae1bdb2fbba8c34 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 12:50:51 -0400
Subject: [PATCH 06/12] Fix spm memory leak
---
status.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/status.c b/status.c
index f4418500..116b28c0 100644
--- a/status.c
+++ b/status.c
@@ -1628,6 +1628,7 @@ status_prompt_complete_window_menu(struct client *c, struct session *s,
}
if (size == 0) {
menu_free(menu);
+ free(spm);
return (NULL);
}
if (size == 1) {
@@ -1638,6 +1639,7 @@ status_prompt_complete_window_menu(struct client *c, struct session *s,
} else
tmp = list[0];
free(list);
+ free(spm);
return (tmp);
}
if (height > size)
--
2.31.1

@ -1,27 +0,0 @@
From 43f00a273beaf63778cb34c925489f0f003ebef7 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 13:02:37 -0400
Subject: [PATCH 07/12] Don't leak the original value memory
---
window-customize.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/window-customize.c b/window-customize.c
index 34a13f73..50cfbdf7 100644
--- a/window-customize.c
+++ b/window-customize.c
@@ -806,6 +806,10 @@ window_customize_draw_option(struct window_customize_modedata *data,
break;
}
}
+
+ free(value);
+ value = NULL;
+
if (wo != NULL && options_owner(o) != wo) {
parent = options_get_only(wo, name);
if (parent != NULL) {
--
2.31.1

@ -1,41 +0,0 @@
From c4860205ea28136a75bfbfb5f70a793770c73c82 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 13:05:09 -0400
Subject: [PATCH 08/12] Don't leak expanded
---
window-customize.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/window-customize.c b/window-customize.c
index 50cfbdf7..7d3cbb18 100644
--- a/window-customize.c
+++ b/window-customize.c
@@ -658,7 +658,7 @@ window_customize_draw_option(struct window_customize_modedata *data,
struct grid_cell gc;
const char **choice, *text, *name;
const char *space = "", *unit = "";
- char *value = NULL, *expanded;
+ char *value = NULL, *expanded = NULL;
char *default_value = NULL;
char choices[256] = "";
struct cmd_find_state fs;
@@ -745,6 +745,7 @@ window_customize_draw_option(struct window_customize_modedata *data,
goto out;
}
free(expanded);
+ expanded = NULL;
}
if (oe != NULL && oe->type == OPTIONS_TABLE_CHOICE) {
for (choice = oe->choices; *choice != NULL; choice++) {
@@ -835,6 +836,7 @@ window_customize_draw_option(struct window_customize_modedata *data,
out:
free(value);
free(default_value);
+ free(expanded);
format_free(ft);
}
--
2.31.1

@ -1,26 +0,0 @@
From aea74c289c6000b86964ad0bb9ac1a05bba2456a Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 7 Apr 2023 16:29:55 -0400
Subject: [PATCH 09/12] Fix buf memory leak
---
cmd-capture-pane.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c
index 6f37bc8f..341d1048 100644
--- a/cmd-capture-pane.c
+++ b/cmd-capture-pane.c
@@ -226,8 +226,8 @@ cmd_capture_pane_exec(struct cmd *self, struct cmdq_item *item)
}
file_print_buffer(c, buf, len);
file_print(c, "\n");
- free(buf);
}
+ free(buf);
} else {
bufname = NULL;
if (args_has(args, 'b'))
--
2.31.1

@ -0,0 +1,13 @@
--- screen-write.c.orig 2023-12-12 21:17:02.960288969 +0100
+++ screen-write.c 2023-12-12 21:18:07.498869550 +0100
@@ -2120,6 +2120,10 @@
return (0);
}
+ /* Check if this combined character would be too long. */
+ if (last.data.size + ud->size > sizeof last.data.data)
+ return (0);
+
/* Combining; flush any pending output. */
screen_write_collect_flush(ctx, 0, __func__);

@ -1,37 +1,40 @@
%global _hardened_build 1
Name: tmux
Version: 3.2a
Release: 5%{?dist}
%global forgeurl https://github.com/tmux/%{name}
%global commit b202a2f1b517a3de7141fc35fbd9e39ed5ac5284
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%forgemeta
Version: 3.3a
# forge meta appends commit info
Release: 11%{?dist}
Summary: A terminal multiplexer
# Most of the source is ISC licensed; some of the files in compat/ are 2 and
# 3 clause BSD licensed.
License: ISC and BSD
License: ISC AND BSD-2-Clause AND BSD-3-Clause AND SSH-short AND LicenseRef-Fedora-Public-Domain
URL: https://tmux.github.io/
Source0: https://github.com/tmux/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
Source0: %{forgesource}
# Examples has been removed - so include the bash_completion here
Source1: bash_completion_tmux.sh
Patch1: 0001-Fix-memory-leaks.patch
Patch2: 0002-Close-file-stream-on-error.patch
Patch3: 0003-Fix-memory-leak-with-time_format.patch
Patch4: 0004-Fix-memory-leak-with-condition-on-error-path.patch
Patch5: 0005-Free-s-even-if-there-is-no-expanded-format.patch
Patch6: 0006-Fix-spm-memory-leak.patch
Patch7: 0007-Don-t-leak-the-original-value-memory.patch
Patch8: 0008-Don-t-leak-expanded.patch
Patch9: 0009-Fix-buf-memory-leak.patch
BuildRequires: make
# don't crash instead of displaying certain glyphs
# https://bugzilla.redhat.com/show_bug.cgi?id=2253441
# applied by upstream: https://github.com/tmux/tmux/issues/3729
Patch0: mitigate-character-length-crash.patch
BuildRequires: byacc
BuildRequires: gcc
BuildRequires: bison
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: pkgconfig(libevent)
BuildRequires: systemd-devel
BuildRequires: libutempter-devel
BuildRequires: make
BuildRequires: pkgconfig(libevent_core) >= 2
BuildRequires: pkgconfig(tinfo)
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(ncursesw)
BuildRequires: libutempter-devel
%if "%0{?commit}" != "0"
BuildRequires: automake
%endif
%description
tmux is a "terminal multiplexer." It enables a number of terminals (or
@ -40,13 +43,14 @@ intended to be a simple, modern, BSD-licensed alternative to programs such
as GNU Screen.
%prep
%setup
%autopatch
%forgesetup
%patch 0 -p0
%build
autoreconf -f -i -v
%configure
%if "%0{?commit}" != "0"
sh ./autogen.sh
%endif
%configure --enable-systemd
%make_build
@ -75,39 +79,63 @@ if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then
fi
%files
%doc CHANGES
%doc example_tmux.conf
%license COPYING
%doc CHANGES README* example_tmux.conf
%{_bindir}/tmux
%{_mandir}/man1/tmux.1.*
%{_datadir}/bash-completion/completions/tmux
%changelog
* Mon Apr 10 2023 Josh Boyer <jwboyer@redhat.com> - 3.2a-5
- Backport a number of memory leak fixes
Resolves: rhbz#1938885
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 3.3a-11
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 3.3a-10
- Rebuilt for MSVSphere 10
* Wed Jun 26 2024 Josef Ridky <jridky@redhat.com> - 3.3a-10
- Add gating.yaml file
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 3.3a-9
- Bump release for June 2024 mass rebuild
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.3a-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Dec 12 2023 Sven Lankes <sven@lank.es> - 3.3a-7.20230918gitb202a2f
- Don't crash on showing certain glyph
Resolves: rhbz#2253441
* Mon Oct 02 2023 David Cantrell <dcantrell@redhat.com> - 3.3a-6.20230918gitb202a2f
- Convert License tag to SPDX expression
* Mon Sep 18 2023 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 3.3a-5.20230918gitb202a2f
- update to snapshot
- https://github.com/tmux/tmux/issues/3699#issuecomment-1723095544
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.3a-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sun Feb 12 2023 Filipe Rosset <rosset.filipe@gmail.com> - 3.3a-3
- Enable support for systemd socket activation fixes rhbz#2158980
* Fri Dec 03 2021 David Cantrell <dcantrell@redhat.com> - 3.2a-4
- Rebuild
Resolves: rhbz#2003007
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.3a-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Sep 27 2021 David Cantrell <dcantrell@redhat.com> - 3.2a-3
- Rebuild
Related: rhbz#1910707
* Fri Aug 19 2022 Filipe Rosset <rosset.filipe@gmail.com> - 3.3a-1
- Update to 3.3a
* Wed Sep 22 2021 David Cantrell <dcantrell@redhat.com> - 3.2a-2
- Ensure gating test files are present in the source repo
Related: rhbz#1910707
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2a-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Sep 01 2021 David Cantrell <dcantrell@redhat.com> - 3.2a-1
- Upgrade to tmux-3.2a (CVE-2020-27347)
Resolves: rhbz#1910707
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2a-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 3.1c-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2a-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.1c-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Jul 02 2021 Igor Raits <ignatenkobrain@fedoraproject.org> - 3.2a-1
- Update to 3.2a
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1c-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save