summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/ncurses/files/CVE-2025-6141.patch
blob: 331535e4d2125e88f64f9962a635eb18dc26b91d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 27d1493340d714e7be6e08c0a8f43e48276149c4 Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Sat, 29 Mar 2025 22:52:37 +0000
Subject: [PATCH] snapshot of project "ncurses", label v6_5_20250329

CVE: CVE-2025-6141
Upstream-Status: Backport [https://github.com/ThomasDickey/ncurses-snapshots/commit/27d1493340d714e7be6e08c0a8f43e48276149c4]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 ncurses/tinfo/parse_entry.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
index a2278c07..c551c780 100644
--- a/ncurses/tinfo/parse_entry.c
+++ b/ncurses/tinfo/parse_entry.c
@@ -954,6 +954,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;