[libedit] Resolves: #1055409 - avoid SIGSEGV in clear_history()

Kamil Dudka kdudka at fedoraproject.org
Tue Jan 21 14:16:11 UTC 2014


commit af557c494175d9963456de1d73c59a481bc6996c
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Tue Jan 21 13:25:09 2014 +0100

    Resolves: #1055409 - avoid SIGSEGV in clear_history()
    
    ... if called prior to using_history()

 libedit-20130712-history.patch |   56 ++++++++++++++++++++++++++++++++++++++++
 libedit.spec                   |    9 +++++-
 2 files changed, 64 insertions(+), 1 deletions(-)
---
diff --git a/libedit-20130712-history.patch b/libedit-20130712-history.patch
new file mode 100644
index 0000000..3ca5f56
--- /dev/null
+++ b/libedit-20130712-history.patch
@@ -0,0 +1,56 @@
+From b595cb4f3aa7b7378999445e8b9be0811bdb1ec9 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi at php.net>
+Date: Tue, 21 Jan 2014 13:03:12 +0100
+Subject: [PATCH 1/2] [libedit] readline: avoid SIGSEGV in clear_history()
+
+... if called prior to using_history().  This needed to be worked around
+in PHP: http://git.php.net/?p=php-src.git;a=commitdiff;h=31d67bd3
+
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1055409
+---
+ src/readline.c |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/src/readline.c b/src/readline.c
+index 8cb43b9..a76a570 100644
+--- a/src/readline.c
++++ b/src/readline.c
+@@ -1479,6 +1479,9 @@ clear_history(void)
+ {
+ 	HistEvent ev;
+ 
++	if (h == NULL || e == NULL)
++		rl_initialize();
++
+ 	(void)history(h, &ev, H_CLEAR);
+ 	history_length = 0;
+ }
+-- 
+1.7.1
+
+
+From ffe1db33353b4a95d6018b77190dfb0c8e2e7cf3 Mon Sep 17 00:00:00 2001
+From: Ondrej Vasik <ovasik at redhat.com>
+Date: Wed, 24 Jul 2013 16:15:32 +0200
+Subject: [PATCH 2/2] [libedit] examples/fileman.c: fix minor typo in a comment
+
+---
+ examples/fileman.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/examples/fileman.c b/examples/fileman.c
+index 2d1a0d4..8cf89b3 100644
+--- a/examples/fileman.c
++++ b/examples/fileman.c
+@@ -3,7 +3,7 @@
+    to manipulate files and their modes.
+ 
+    NOTE: this was taken from the GNU Readline documentation and ported
+-   to libedit. A commad to output the history list was added.
++   to libedit. A command to output the history list was added.
+    
+    */
+ 
+-- 
+1.7.1
+
diff --git a/libedit.spec b/libedit.spec
index 96253a3..578e234 100644
--- a/libedit.spec
+++ b/libedit.spec
@@ -3,12 +3,15 @@
 Summary:	The NetBSD Editline library
 Name:		libedit
 Version:	3.1
-Release:	3.%{snap}cvs%{?dist}
+Release:	4.%{snap}cvs%{?dist}
 License:	BSD
 Group:		System Environment/Libraries
 URL:		http://www.thrysoee.dk/editline/
 Source0:	http://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz
 
+# avoid SIGSEGV in clear_history() if called prior to using_history() (#1055409)
+Patch1:		libedit-20130712-history.patch
+
 BuildRequires:	ncurses-devel
 
 %description
@@ -29,6 +32,7 @@ This package contains development files for %{name}.
 
 %prep
 %setup -q -n %{name}-%{snap}-%{version}
+%patch1 -p1
 
 # Suppress rpmlint error.
 iconv -f ISO8859-1 -t UTF-8 -o ChangeLog.utf-8 ChangeLog
@@ -67,6 +71,9 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -delete
 %{_includedir}/editline/readline.h
 
 %changelog
+* Tue Jan 21 2014 Kamil Dudka <kdudka at redhat.com> - 3.1-4.20130712cvs
+- avoid SIGSEGV in clear_history() if called prior to using_history() (#1055409)
+
 * Thu Jan 02 2014 Kamil Dudka <kdudka at redhat.com> - 3.1-3.20130712cvs
 - Update to 20130712-3.1 (#1045675)
 - Do not mark man pages as %%doc (#1045675)


More information about the scm-commits mailing list