From 8ea59a72ca81d216c8a0a2df22f5cc067e7de33a Mon Sep 17 00:00:00 2001 From: beta Date: Wed, 8 Jan 2025 13:39:07 +0800 Subject: [PATCH] backport patch to fix segmentation fault problem Signed-off-by: beta (cherry picked from commit 05d5c14b0d12ae95841e3e9657e84e7535edf9d4) --- ...ch-1-fix-crash-when-readline-is-star.patch | 41 +++++++++++++++++++ readline.spec | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 backport-Readline-8.2-patch-1-fix-crash-when-readline-is-star.patch diff --git a/backport-Readline-8.2-patch-1-fix-crash-when-readline-is-star.patch b/backport-Readline-8.2-patch-1-fix-crash-when-readline-is-star.patch new file mode 100644 index 0000000..2ee1dc9 --- /dev/null +++ b/backport-Readline-8.2-patch-1-fix-crash-when-readline-is-star.patch @@ -0,0 +1,41 @@ +From 7274faabe97ce53d6b464272d7e6ab6c1392837b Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Wed, 5 Oct 2022 10:41:16 -0400 +Subject: [PATCH] Readline-8.2 patch 1: fix crash when readline is started with + an invalid locale specification + +Conflict: The file ._.gitignore does not exist. +Reference: http://git.savannah.gnu.org/cgit/readline.git/commit/?id=7274faabe97ce53d6b464272d7e6ab6c1392837b + +--- + nls.c | 4 ++++ + patchlevel | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/nls.c b/nls.c +index 5c6a13b..8c027d6 100644 +--- a/nls.c ++++ b/nls.c +@@ -141,6 +141,10 @@ _rl_init_locale (void) + if (lspec == 0) + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; + #else + ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec; + #endif +diff --git a/patchlevel b/patchlevel +index d8c9df7..fdf4740 100644 +--- a/patchlevel ++++ b/patchlevel +@@ -1,3 +1,3 @@ + # Do not edit -- exists only for use by patch + +-0 ++1 +-- +2.46.0 + diff --git a/readline.spec b/readline.spec index 682e60d..d449cc5 100644 --- a/readline.spec +++ b/readline.spec @@ -1,6 +1,6 @@ Name: readline Version: 8.2 -Release: 2 +Release: 3 Summary: Readline library for editing typed command lines License: GPLv3+ @@ -8,6 +8,7 @@ URL: http://tiswww.case.edu/php/chet/readline/rltop.html Source0: http://git.savannah.gnu.org/cgit/readline.git/snapshot/%{name}-%{version}.tar.gz Patch0: readline-8.0-shlib.patch +Patch1: backport-Readline-8.2-patch-1-fix-crash-when-readline-is-star.patch BuildRequires: gcc gcc-c++ ncurses-devel @@ -80,6 +81,9 @@ export CPPFLAGS="-I%{_includedir}/ncurses" %changelog +* Wed Jan 8 2025 beta - 8.2-3 +- backport patch to fix segmentation fault problem + * Wed Feb 1 2023 chenziyang - 8.2-2 - upload readline-8.0-shlib.patch to fix undefined symbol problem -- Gitee