[expect] Fix character matching to avoid segmentation fault, Move libexpect link out of -devel subpackage
vcrhonek
vcrhonek at fedoraproject.org
Mon Feb 6 14:28:46 UTC 2012
commit 367d367bb9fe4b98dd684567c73140886239cc1b
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date: Mon Feb 6 15:28:30 2012 +0100
Fix character matching to avoid segmentation fault, Move libexpect link out of -devel subpackage
expect-5.45-match-gt-numchars-segfault.patch | 17 +++++++++++++++++
expect.spec | 11 +++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/expect-5.45-match-gt-numchars-segfault.patch b/expect-5.45-match-gt-numchars-segfault.patch
new file mode 100644
index 0000000..1abd424
--- /dev/null
+++ b/expect-5.45-match-gt-numchars-segfault.patch
@@ -0,0 +1,17 @@
+diff -up expect5.45/expect.c.orig expect5.45/expect.c
+--- expect5.45/expect.c.orig 2012-02-06 14:15:13.469490744 +0100
++++ expect5.45/expect.c 2012-02-06 14:16:23.596837896 +0100
+@@ -2363,7 +2363,12 @@ expMatchProcess(
+
+ /* "!e" means no case matched - transfer by default */
+ if (!e || e->transfer) {
+- int remainder = numchars-match;
++ int remainder;
++ if (match > numchars) {
++ match = numchars;
++ eo->matchlen = match;
++ }
++ remainder = numchars-match;
+ /* delete matched chars from input buffer */
+ esPtr->printed -= match;
+ if (numchars != 0) {
diff --git a/expect.spec b/expect.spec
index f103d4e..2010ae0 100644
--- a/expect.spec
+++ b/expect.spec
@@ -5,7 +5,7 @@
Summary: A program-script interaction and testing utility
Name: expect
Version: %{majorver}
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Public Domain
Group: Development/Languages
# URL: probably more useful is http://sourceforge.net/projects/expect/
@@ -19,6 +19,8 @@ Patch0: expect-5.43.0-log_file.patch
Patch1: expect-5.43.0-pkgpath.patch
# Patch2: fixes minor man page formatting issue
Patch2: expect-5.45-man-page.patch
+# Patch3: fixes segmentation fault during matching characters
+Patch3: expect-5.45-match-gt-numchars-segfault.patch
# examples patches
# Patch100: changes random function
Patch100: expect-5.32.2-random.patch
@@ -73,6 +75,7 @@ of expectk.
%patch0 -p1 -b .log_file
%patch1 -p1 -b .pkgpath
%patch2 -p1 -b .man-page
+%patch3 -p1 -b .match-gt-numchars-segfault
# examples fixes
%patch100 -p1 -b .random
%patch101 -p1 -b .mkpasswd-dash
@@ -135,6 +138,7 @@ rm -rf "$RPM_BUILD_ROOT"
%dir %{tcl_sitearch}/expect%{version}
%{tcl_sitearch}/expect%{version}/pkgIndex.tcl
%{_libdir}/libexpect%{version}.so
+%{_libdir}/libexpect.so
%{_mandir}/man1/autoexpect.1.gz
%{_mandir}/man1/dislocate.1.gz
%{_mandir}/man1/expect.1.gz
@@ -147,7 +151,6 @@ rm -rf "$RPM_BUILD_ROOT"
%files devel
%defattr(-,root,root,-)
-%{_libdir}/libexpect.so
%{_mandir}/man3/libexpect.3*
%{_includedir}/*
@@ -161,6 +164,10 @@ rm -rf "$RPM_BUILD_ROOT"
%{_mandir}/man1/tknewsbiff.1*
%changelog
+* Mon Feb 06 2012 Vitezslav Crhonek <vcrhonek at redhat.com> - 5.45-6
+- Fix character matching to avoid segmentation fault
+- Move libexpect link out of -devel subpackage
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.45-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list