Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
6c9cddd910
!109 [sync] PR-106: Add sw_64 support
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2025-02-25 03:22:18 +00:00
zhangshaoning
eeac020d84 Add sw_64 support
(cherry picked from commit 1fafb0078a01b1cf02ae9a6362e0f97e68d5129c)
2025-02-19 09:58:47 +08:00
openeuler-ci-bot
2752b605a6
!94 sysboost no longer needs relocation,so remove it
From: @yangl777 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2024-02-28 09:31:40 +00:00
yangl777
f4dc7ec415 sysboost no longer needs relocation,so remove it 2024-02-28 09:00:51 +00:00
openeuler-ci-bot
276c126a82
!83 fix CVE-2023-45918
From: @yangl777 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2024-01-30 09:27:22 +00:00
yangl777
8481c89d7a fix CVE-2023-45918 2024-01-30 08:25:28 +00:00
openeuler-ci-bot
bd71516580
!78 fix CVE-2023-50495
From: @yangl777 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2023-12-18 02:40:29 +00:00
yangl777
5acab784f1 fix CVE-2023-50495 2023-12-15 15:59:56 +08:00
openeuler-ci-bot
f6df0868ea
!72 add relocation package for ncurse on master
From: @a-carter-bear 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2023-08-09 07:45:10 +00:00
l00580197
a44ecfd035 fixed 6d31a5f from https://gitee.com/a-carter-bear/ncurses/pulls/71
add relocation package for sysboost
2023-08-09 02:17:00 +00:00
4 changed files with 342 additions and 2 deletions

View File

@ -0,0 +1,194 @@
From 6107f670972c4bb79b5f8cfb1f12cc037271a7ee Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Thu, 15 Jun 2023 20:51:06 +0000
Subject: [PATCH] snapshot of project "ncurses", label v6_4_20230615
Conflict:remove unnecessary modifications
Reference:https://github.com/ThomasDickey/ncurses-snapshots/commit/6107f670972c4bb79b5f8cfb1f12cc037271a7ee
---
ncurses/tinfo/comp_error.c | 17 +++++---
ncurses/tinfo/read_entry.c | 67 ++++++++++++++++++++++----------
2 files changed, 57 insertions(+), 27 deletions(-)
diff --git a/ncurses/tinfo/comp_error.c b/ncurses/tinfo/comp_error.c
index aa745a6df..3e6b4022a 100644
--- a/ncurses/tinfo/comp_error.c
+++ b/ncurses/tinfo/comp_error.c
@@ -42,7 +42,7 @@
#include <tic.h>
-MODULE_ID("$Id: comp_error.c,v 1.40 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: comp_error.c,v 1.44 2023/06/15 20:27:02 tom Exp $")
NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
@@ -60,8 +60,15 @@ _nc_get_source(void)
NCURSES_EXPORT(void)
_nc_set_source(const char *const name)
{
- FreeIfNeeded(SourceName);
- SourceName = strdup(name);
+ if (name == NULL) {
+ free(SourceName);
+ SourceName = NULL;
+ } else if (SourceName == NULL) {
+ SourceName = strdup(name);
+ } else if (strcmp(name, SourceName)) {
+ free(SourceName);
+ SourceName = strdup(name);
+ }
}
NCURSES_EXPORT(void)
@@ -95,9 +102,9 @@ static NCURSES_INLINE void
where_is_problem(void)
{
fprintf(stderr, "\"%s\"", SourceName ? SourceName : "?");
- if (_nc_curr_line >= 0)
+ if (_nc_curr_line > 0)
fprintf(stderr, ", line %d", _nc_curr_line);
- if (_nc_curr_col >= 0)
+ if (_nc_curr_col > 0)
fprintf(stderr, ", col %d", _nc_curr_col);
if (TermType != 0 && TermType[0] != '\0')
fprintf(stderr, ", terminal '%s'", TermType);
diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c
index 87e422aee..762c6c68c 100644
--- a/ncurses/tinfo/read_entry.c
+++ b/ncurses/tinfo/read_entry.c
@@ -42,7 +42,7 @@
#include <tic.h>
-MODULE_ID("$Id: read_entry.c,v 1.164 2022/05/08 00:11:44 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.169 2023/06/15 20:51:06 tom Exp $")
#define MyNumber(n) (short) LOW_MSB(n)
@@ -138,12 +138,13 @@ convert_16bits(char *buf, NCURSES_INT2 *Numbers, int count)
}
#endif
-static void
-convert_strings(char *buf, char **Strings, int count, int size, char *table)
+static bool
+convert_strings(char *buf, char **Strings, int count, int size,
+ char *table, bool always)
{
int i;
char *p;
- bool corrupt = FALSE;
+ bool success = TRUE;
for (i = 0; i < count; i++) {
if (IS_NEG1(buf + 2 * i)) {
@@ -159,13 +160,10 @@ convert_strings(char *buf, char **Strings, int count, int size, char *table)
TR(TRACE_DATABASE, ("Strings[%d] = %s", i,
_nc_visbuf(Strings[i])));
} else {
- if (!corrupt) {
- corrupt = TRUE;
- TR(TRACE_DATABASE,
- ("ignore out-of-range index %d to Strings[]", nn));
- _nc_warning("corrupt data found in convert_strings");
- }
- Strings[i] = ABSENT_STRING;
+ TR(TRACE_DATABASE,
+ ("found out-of-range index %d to Strings[%d]", nn, i));
+ success = FALSE;
+ break;
}
}
@@ -175,10 +173,25 @@ convert_strings(char *buf, char **Strings, int count, int size, char *table)
if (*p == '\0')
break;
/* if there is no NUL, ignore the string */
- if (p >= table + size)
+ if (p >= table + size) {
Strings[i] = ABSENT_STRING;
+ } else if (p == Strings[i] && always) {
+ TR(TRACE_DATABASE,
+ ("found empty but required Strings[%d]", i));
+ success = FALSE;
+ break;
+ }
+ } else if (always) { /* names are always needed */
+ TR(TRACE_DATABASE,
+ ("found invalid but required Strings[%d]", i));
+ success = FALSE;
+ break;
}
}
+ if (!success) {
+ _nc_warning("corrupt data found in convert_strings");
+ }
+ return success;
}
static int
@@ -382,7 +395,10 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
if (Read(string_table, (unsigned) str_size) != str_size) {
returnDB(TGETENT_NO);
}
- convert_strings(buf, ptr->Strings, str_count, str_size, string_table);
+ if (!convert_strings(buf, ptr->Strings, str_count, str_size,
+ string_table, FALSE)) {
+ returnDB(TGETENT_NO);
+ }
}
#if NCURSES_XNAMES
@@ -483,8 +499,10 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
("Before computing extended-string capabilities "
"str_count=%d, ext_str_count=%d",
str_count, ext_str_count));
- convert_strings(buf, ptr->Strings + str_count, ext_str_count,
- ext_str_limit, ptr->ext_str_table);
+ if (!convert_strings(buf, ptr->Strings + str_count, ext_str_count,
+ ext_str_limit, ptr->ext_str_table, FALSE)) {
+ returnDB(TGETENT_NO);
+ }
for (i = ext_str_count - 1; i >= 0; i--) {
TR(TRACE_DATABASE, ("MOVE from [%d:%d] %s",
i, i + str_count,
@@ -516,10 +534,13 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
TR(TRACE_DATABASE,
("ext_NAMES starting @%d in extended_strings, first = %s",
base, _nc_visbuf(ptr->ext_str_table + base)));
- convert_strings(buf + (2 * ext_str_count),
- ptr->ext_Names,
- (int) need,
- ext_str_limit, ptr->ext_str_table + base);
+ if (!convert_strings(buf + (2 * ext_str_count),
+ ptr->ext_Names,
+ (int) need,
+ ext_str_limit, ptr->ext_str_table + base,
+ TRUE)) {
+ returnDB(TGETENT_NO);
+ }
}
TR(TRACE_DATABASE,
@@ -572,13 +593,17 @@ _nc_read_file_entry(const char *const filename, TERMTYPE2 *ptr)
int limit;
char buffer[MAX_ENTRY_SIZE + 1];
- if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp))
- > 0) {
+ limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp);
+ if (limit > 0) {
+ const char *old_source = _nc_get_source();
TR(TRACE_DATABASE, ("read terminfo %s", filename));
+ if (old_source == NULL)
+ _nc_set_source(filename);
if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) {
_nc_free_termtype2(ptr);
}
+ _nc_set_source(old_source);
} else {
code = TGETENT_NO;
}

View File

@ -0,0 +1,92 @@
From efe9674ee14b14b788f9618941f97d31742f0adc Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Mon, 24 Apr 2023 23:14:45 +0000
Subject: [PATCH] snapshot of project "ncurses", label v6_4_20230424
Conflict:remove unnecessary modifications
Reference:https://github.com/ThomasDickey/ncurses-snapshots/commit/efe9674ee14b14b788f9618941f97d31742f0adc#diff-92910179510f7aaf9b70441f3c70521140faa34a192f9e28671ee40bbf052dc4
---
ncurses/tinfo/parse_entry.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
index a77cd0b..5390146 100644
--- a/ncurses/tinfo/parse_entry.c
+++ b/ncurses/tinfo/parse_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: parse_entry.c,v 1.107 2022/05/08 00:11:44 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.108 2023/04/24 22:32:33 tom Exp $")
#ifdef LINT
static short const parametrized[] =
@@ -110,7 +110,7 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
/* Well, we are given a cancel for a name that we don't recognize */
return _nc_extend_names(entryp, name, STRING);
default:
- return 0;
+ return NULL;
}
/* Adjust the 'offset' (insertion-point) to keep the lists of extended
@@ -142,6 +142,11 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
for (last = (unsigned) (max - 1); last > tindex; last--)
if (!found) {
+ char *saved;
+
+ if ((saved = _nc_save_str(name)) == NULL)
+ return NULL;
+
switch (token_type) {
case BOOLEAN:
tp->ext_Booleans++;
@@ -169,7 +174,7 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
TYPE_REALLOC(char *, actual, tp->ext_Names);
while (--actual > offset)
tp->ext_Names[actual] = tp->ext_Names[actual - 1];
- tp->ext_Names[offset] = _nc_save_str(name);
+ tp->ext_Names[offset] = saved;
}
temp.nte_name = tp->ext_Names[offset];
@@ -337,6 +342,8 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
bool is_use = (strcmp(_nc_curr_token.tk_name, "use") == 0);
bool is_tc = !is_use && (strcmp(_nc_curr_token.tk_name, "tc") == 0);
if (is_use || is_tc) {
+ char *saved;
+
if (!VALID_STRING(_nc_curr_token.tk_valstring)
|| _nc_curr_token.tk_valstring[0] == '\0') {
_nc_warning("missing name for use-clause");
@@ -350,11 +357,13 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
_nc_curr_token.tk_valstring);
continue;
}
- entryp->uses[entryp->nuses].name = _nc_save_str(_nc_curr_token.tk_valstring);
- entryp->uses[entryp->nuses].line = _nc_curr_line;
- entryp->nuses++;
- if (entryp->nuses > 1 && is_tc) {
- BAD_TC_USAGE
+ if ((saved = _nc_save_str(_nc_curr_token.tk_valstring)) != NULL) {
+ entryp->uses[entryp->nuses].name = saved;
+ entryp->uses[entryp->nuses].line = _nc_curr_line;
+ entryp->nuses++;
+ if (entryp->nuses > 1 && is_tc) {
+ BAD_TC_USAGE
+ }
}
} else {
/* normal token lookup */
--
2.33.0

24
ncurses-sw-support.patch Normal file
View File

@ -0,0 +1,24 @@
diff -arup ncurses-6.3.orig/config.guess ncurses-6.3/config.guess
--- ncurses-6.3.orig/config.guess 2021-06-04 12:01:25.000000000 +0800
+++ ncurses-6.3/config.guess 2023-02-15 09:45:20.743936365 +0800
@@ -1140,6 +1140,9 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
+ sw_64*:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
diff -arup ncurses-6.3.orig/config.sub ncurses-6.3/config.sub
--- ncurses-6.3.orig/config.sub 2021-08-15 00:20:38.000000000 +0800
+++ ncurses-6.3/config.sub 2023-02-15 09:46:19.158924225 +0800
@@ -1262,6 +1262,7 @@ case $cpu-$vendor in
| sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \
+ | sw_64 \
| tahoe \
| thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \

View File

@ -1,6 +1,6 @@
Name: ncurses name: ncurses
Version: 6.4 Version: 6.4
Release: 4 Release: 9
Summary: Terminal control library Summary: Terminal control library
License: MIT License: MIT
URL: https://invisible-island.net/ncurses/ncurses.html URL: https://invisible-island.net/ncurses/ncurses.html
@ -14,6 +14,9 @@ Patch13: backport-0001-CVE-2023-29491-fix-configure-root-args-option.patch
Patch14: backport-0002-CVE-2023-29491-env-access.patch Patch14: backport-0002-CVE-2023-29491-env-access.patch
Patch15: backport-fix-for-out-of-memory-condition.patch Patch15: backport-fix-for-out-of-memory-condition.patch
Patch16: backport-fix-coredump-when-use-Memmove.patch Patch16: backport-fix-coredump-when-use-Memmove.patch
Patch17: backport-CVE-2023-50495.patch
Patch18: backport-CVE-2023-45918.patch
Patch19: ncurses-sw-support.patch
BuildRequires: make gcc gcc-c++ gpm-devel pkgconfig BuildRequires: make gcc gcc-c++ gpm-devel pkgconfig
@ -248,6 +251,33 @@ xz NEWS
%{_mandir}/man7/* %{_mandir}/man7/*
%changelog %changelog
* Mon Feb 17 2025 zhangshaoning <zhangshaoning@uniontech.com> - 6.4-9
- Add sw_64 support
* Wed Feb 28 2024 yanglu <yanglu72@h-partners.com> - 6.4-8
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:sysboost no longer needs relocation,so remove it
* Tue Jan 30 2024 yanglu <yanglu72@h-partners.com> - 6.4-7
- Type:CVE
- CVE:CVE-2023-45918
- SUG:NA
- DESC:fix CVE-2023-45918
* Fri Dec 15 2023 yanglu <yanglu72@huawei.com> - 6.4-6
- Type:CVE
- CVE:CVE-2023-50495
- SUG:NA
- DESC:fix CVE-2023-50495
* Sat Aug 05 2023 longwei <longwei27@huawei.com> - 6.4-5
- Type:requirement
- CVE:NA
- SUG:NA
- DESC:add relocation package for sysboost
* Tue Jul 04 2023 yanglu <yanglu72@h-partners.com> - 6.4-4 * Tue Jul 04 2023 yanglu <yanglu72@h-partners.com> - 6.4-4
- Type:bugfix - Type:bugfix
- CVE:NA - CVE:NA