From 150d817a6e466ee3c70015a5b63814b2cc4c5cbd Mon Sep 17 00:00:00 2001 From: yangl777 Date: Mon, 14 Jul 2025 07:02:25 +0000 Subject: [PATCH] fix CVE-2025-6141 --- backport-CVE-2025-6141.patch | 33 +++++++++++++++++++++++++++++++++ ncurses.spec | 9 ++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2025-6141.patch diff --git a/backport-CVE-2025-6141.patch b/backport-CVE-2025-6141.patch new file mode 100644 index 0000000..764adf9 --- /dev/null +++ b/backport-CVE-2025-6141.patch @@ -0,0 +1,33 @@ +From 27d1493340d714e7be6e08c0a8f43e48276149c4 Mon Sep 17 00:00:00 2001 +From: "Thomas E. Dickey" +Date: Sat, 29 Mar 2025 22:52:37 +0000 +Subject: [PATCH] snapshot of project "ncurses", label v6_5_20250329 + +Conflict:remove unnecessary modifications +Reference:https://github.com/ThomasDickey/ncurses-snapshots/commit/27d1493340d714e7be6e08c0a8f43e48276149c4 +--- + ncurses/tinfo/parse_entry.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c +index a2278c07f..c551c780b 100644 +--- a/ncurses/tinfo/parse_entry.c ++++ b/ncurses/tinfo/parse_entry.c +@@ -48,7 +48,7 @@ + #include + #include + +-MODULE_ID("$Id: parse_entry.c,v 1.108 2023/04/24 22:32:33 tom Exp $") ++MODULE_ID("$Id: parse_entry.c,v 1.116 2025/03/24 22:27:29 tom Exp $") + + #ifdef LINT + static short const parametrized[] = +@@ -990,6 +990,8 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base) + bp = tp->Strings[from_ptr->nte_index]; + if (VALID_STRING(bp)) { + for (dp = buf2; *bp; bp++) { ++ if ((size_t) (dp - buf2) >= (sizeof(buf2) - sizeof(TERMTYPE2))) ++ break; + if (bp[0] == '$' && bp[1] == '<') { + while (*bp && *bp != '>') { + ++bp; diff --git a/ncurses.spec b/ncurses.spec index 1d1aa41..1b248e5 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -1,7 +1,7 @@ %global revision 20200411 Name: ncurses Version: 6.2 -Release: 6 +Release: 7 Summary: Terminal control library License: MIT URL: https://invisible-island.net/ncurses/ncurses.html @@ -17,6 +17,7 @@ Patch14: backport-CVE-2022-29458.patch Patch15: backport-CVE-2023-29491-mitigation.patch Patch16: backport-CVE-2023-50495.patch Patch17: backport-CVE-2023-45918.patch +Patch18: backport-CVE-2025-6141.patch BuildRequires: gcc gcc-c++ gpm-devel pkgconfig @@ -227,6 +228,12 @@ xz NEWS %{_mandir}/man7/* %changelog +* Mon Jul 14 2025 yanglu - 6.2-7 +- Type:CVE +- CVE:CVE-2025-6141 +- SUG:NA +- DESC:fix CVE-2025-6141 + * Tue Jan 30 2024 yanglu - 6.2-6 - Type:CVE - CVE:CVE-2023-45918 -- Gitee