From a0fe47e4c6daaff87ed1daf07f74bf1c938c48aa Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 22 Mar 2007 11:04:51 +0000 Subject: [PATCH] - apply 5.2-002 patch --- readline-5.2-002.patch | 49 ++++++++++++++++++++++++++++++++++++++++++ readline.spec | 7 +++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 readline-5.2-002.patch diff --git a/readline-5.2-002.patch b/readline-5.2-002.patch new file mode 100644 index 0000000..b0d8c92 --- /dev/null +++ b/readline-5.2-002.patch @@ -0,0 +1,49 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 5.2 +Patch-ID: readline52-002 + +Bug-Reported-by: Magnus Svensson +Bug-Reference-ID: <45BDC44D.80609@mysql.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html + +Bug-Description: + +Readline neglects to reallocate the array it uses to keep track of wrapped +screen lines when increasing its size. This will eventually result in +segmentation faults when given sufficiently long input. + +Patch: + +*** ../readline-5.2-patched/display.c Thu Sep 14 14:20:12 2006 +--- display.c Fri Feb 2 20:23:17 2007 +*************** +*** 561,574 **** +--- 561,586 ---- + wrap_offset = prompt_invis_chars_first_line = 0; + } + ++ #if defined (HANDLE_MULTIBYTE) + #define CHECK_INV_LBREAKS() \ + do { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ ++ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \ + } \ + } while (0) ++ #else ++ #define CHECK_INV_LBREAKS() \ ++ do { \ ++ if (newlines >= (inv_lbsize - 2)) \ ++ { \ ++ inv_lbsize *= 2; \ ++ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ ++ } \ ++ } while (0) ++ #endif /* HANDLE_MULTIBYTE */ + + #if defined (HANDLE_MULTIBYTE) + #define CHECK_LPOS() \ diff --git a/readline.spec b/readline.spec index 57a30c1..7208a89 100644 --- a/readline.spec +++ b/readline.spec @@ -1,13 +1,14 @@ Summary: A library for editing typed command lines Name: readline Version: 5.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL Group: System Environment/Libraries URL: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html Source: ftp://ftp.gnu.org/gnu/readline-%{version}.tar.gz Patch1: readline-5.2-shlib.patch Patch2: readline-5.2-001.patch +Patch3: readline-5.2-002.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info BuildRequires: ncurses-devel @@ -48,6 +49,7 @@ library. %setup -q %patch1 -p1 -b .shlib %patch2 -p0 -b .001 +%patch3 -p0 -b .002 rm -f examples/rlfe/configure @@ -111,6 +113,9 @@ fi %{_libdir}/lib*.a %changelog +* Thu Mar 22 2007 Miroslav Lichvar 5.2-4 +- apply 5.2-002 patch + * Thu Mar 15 2007 Miroslav Lichvar 5.2-3 - link libreadline with libtinfo (#232277) - include upstream 5.2-001 patch