From 49648f21ba4fe2ee23e177f4e28ea09deb36d126 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 18 Jul 2012 14:07:48 +0200 Subject: [PATCH] fix crash of el_insertstr() on incomplete multi-byte sequence (#840598) --- libedit-20120601-3.0-insertstr-mb.patch | 27 +++++++++++++++++++++++++ libedit.spec | 5 +++++ 2 files changed, 32 insertions(+) create mode 100644 libedit-20120601-3.0-insertstr-mb.patch diff --git a/libedit-20120601-3.0-insertstr-mb.patch b/libedit-20120601-3.0-insertstr-mb.patch new file mode 100644 index 0000000..94102d8 --- /dev/null +++ b/libedit-20120601-3.0-insertstr-mb.patch @@ -0,0 +1,27 @@ +From 73a91fafe8da0a1e8905280e8fa861a5d1d0e698 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 18 Jul 2012 14:11:55 +0200 +Subject: [PATCH] fix crash of el_insertstr() on incomplete multi-byte + sequence + +https://bugzilla.redhat.com/840598 +--- + src/chared.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/chared.c b/src/chared.c +index f816d89..d3b0f22 100644 +--- a/src/chared.c ++++ b/src/chared.c +@@ -612,7 +612,7 @@ FUN(el,insertstr)(EditLine *el, const Char *s) + { + size_t len; + +- if ((len = Strlen(s)) == 0) ++ if (s == NULL || (len = Strlen(s)) == 0) + return -1; + if (el->el_line.lastchar + len >= el->el_line.limit) { + if (!ch_enlargebufs(el, len)) +-- +1.7.10.4 + diff --git a/libedit.spec b/libedit.spec index 2f57d84..425157a 100644 --- a/libedit.spec +++ b/libedit.spec @@ -9,6 +9,9 @@ Group: System Environment/Libraries URL: http://www.thrysoee.dk/editline/ Source0: http://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz +# fix crash of el_insertstr() on incomplete multi-byte sequence (#840598) +Patch0: libedit-20120601-3.0-insertstr-mb.patch + BuildRequires: ncurses-devel %description @@ -29,6 +32,7 @@ This package contains development files for %{name}. %prep %setup -q -n %{name}-%{snap}-%{version} +%patch0 -p1 # Suppress rpmlint error. iconv -f ISO8859-1 -t UTF-8 -o ChangeLog.utf-8 ChangeLog @@ -76,6 +80,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Wed Jul 18 2012 Kamil Dudka 3.0-7.20120601cvs - Update to 3.0 (20120601 snap) +- fix crash of el_insertstr() on incomplete multi-byte sequence (#840598) * Fri Jan 13 2012 Fedora Release Engineering - 3.0-6.20110802cvs - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild