summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-03 23:22:00 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-03 23:22:00 +0000
commit2402a67588bbfd80ccd76f803184f79d27e88833 (patch)
treee1153591ae79f05faf5b61f6ab6ebe2e4678e954 /app-editors
parentFix digest with bad RMD160 from broken pycrypto on ia64 (diff)
downloadgentoo-2-2402a67588bbfd80ccd76f803184f79d27e88833.tar.gz
gentoo-2-2402a67588bbfd80ccd76f803184f79d27e88833.tar.bz2
gentoo-2-2402a67588bbfd80ccd76f803184f79d27e88833.zip
Grab fix from upstream for segfaults with some files #111564.
(Portage version: 2.1_pre4-r1)
Diffstat (limited to 'app-editors')
-rw-r--r--app-editors/nano/ChangeLog9
-rw-r--r--app-editors/nano/files/digest-nano-1.3.10-r1 (renamed from app-editors/nano/files/digest-nano-1.3.10)0
-rw-r--r--app-editors/nano/files/nano-1.3.10-crash.patch64
-rw-r--r--app-editors/nano/nano-1.3.10-r1.ebuild (renamed from app-editors/nano/nano-1.3.10.ebuild)3
4 files changed, 74 insertions, 2 deletions
diff --git a/app-editors/nano/ChangeLog b/app-editors/nano/ChangeLog
index 1095a27d09ee..9279b67333b1 100644
--- a/app-editors/nano/ChangeLog
+++ b/app-editors/nano/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-editors/nano
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.91 2006/01/17 00:39:09 redhatter Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.92 2006/02/03 23:22:00 vapier Exp $
+
+*nano-1.3.10-r1 (03 Feb 2006)
+
+ 03 Feb 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/nano-1.3.10-crash.patch, -nano-1.3.10.ebuild,
+ +nano-1.3.10-r1.ebuild:
+ Grab fix from upstream for segfaults with some files #111564.
17 Jan 2006; Stuart Longland <redhatter@gentoo.org> nano-1.3.9.ebuild:
Marked nano-1.3.9 stable on mips as per bug #118946
diff --git a/app-editors/nano/files/digest-nano-1.3.10 b/app-editors/nano/files/digest-nano-1.3.10-r1
index f0410784444b..f0410784444b 100644
--- a/app-editors/nano/files/digest-nano-1.3.10
+++ b/app-editors/nano/files/digest-nano-1.3.10-r1
diff --git a/app-editors/nano/files/nano-1.3.10-crash.patch b/app-editors/nano/files/nano-1.3.10-crash.patch
new file mode 100644
index 000000000000..f0fdd856b6c7
--- /dev/null
+++ b/app-editors/nano/files/nano-1.3.10-crash.patch
@@ -0,0 +1,64 @@
+http://bugs.gentoo.org/111564
+http://lists.gnu.org/archive/html/nano-devel/2006-02/msg00006.html
+
+diff -ur nano-1.3.7/src/winio.c nano-1.3.7-fixed/src/winio.c
+--- nano-1.3.7/src/winio.c 2005-04-10 23:51:22.000000000 -0400
++++ nano-1.3.7-fixed/src/winio.c 2006-02-02 23:47:01.000000000 -0500
+@@ -2253,10 +2253,22 @@
+
+ assert(column <= start_col);
+
+- /* Allocate enough space for the entire line. */
+- alloc_len = (mb_cur_max() * (COLS + 1));
++ /* Make sure there's enough room for the initial character, whether
++ * it's a multibyte control character, a non-control multibyte
++ * character, a tab character, or a null terminator. Rationale:
++ *
++ * multibyte control character followed by a null terminator:
++ * 1 byte ('^') + mb_cur_max() bytes + 1 byte ('\0')
++ * multibyte non-control character followed by a null terminator:
++ * mb_cur_max() bytes + 1 byte ('\0')
++ * tab character followed by a null terminator:
++ * mb_cur_max() bytes + (tabsize - 1) bytes + 1 byte ('\0')
++ *
++ * Since tabsize has a minimum value of 1, it can substitute for 1
++ * byte above. */
++ alloc_len = (mb_cur_max() + tabsize + 1) * 128;
++ converted = charalloc(alloc_len);
+
+- converted = charalloc(alloc_len + 1);
+ index = 0;
+
+ if (buf[start_index] != '\t' && (column < start_col || (dollars &&
+@@ -2295,9 +2306,17 @@
+ #endif
+ }
+
+- while (index < alloc_len - 1 && buf[start_index] != '\0') {
++ while (buf[start_index] != '\0') {
+ buf_mb_len = parse_mbchar(buf + start_index, buf_mb, NULL);
+
++ /* Make sure there's enough room for the next character, whether
++ * it's a multibyte control character, a non-control multibyte
++ * character, a tab character, or a null terminator. */
++ if (index + mb_cur_max() + tabsize + 1 >= alloc_len - 1) {
++ alloc_len += (mb_cur_max() + tabsize + 1) * 128;
++ converted = charealloc(converted, alloc_len);
++ }
++
+ /* If buf contains a tab character, interpret it. */
+ if (*buf_mb == '\t') {
+ #if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
+@@ -2379,8 +2398,10 @@
+ start_index += buf_mb_len;
+ }
+
+- if (index < alloc_len - 1)
+- converted[index] = '\0';
++ assert(alloc_len >= index + 1);
++
++ /* Null terminate converted. */
++ converted[index] = '\0';
+
+ /* Make sure converted takes up no more than len columns. */
+ index = actual_x(converted, len);
diff --git a/app-editors/nano/nano-1.3.10.ebuild b/app-editors/nano/nano-1.3.10-r1.ebuild
index 2c0b5361bceb..9d7ee47ccd12 100644
--- a/app-editors/nano/nano-1.3.10.ebuild
+++ b/app-editors/nano/nano-1.3.10-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/nano-1.3.10.ebuild,v 1.2 2006/01/11 04:28:56 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/nano-1.3.10-r1.ebuild,v 1.1 2006/02/03 23:22:00 vapier Exp $
#ECVS_SERVER="savannah.gnu.org:/cvsroot/nano"
#ECVS_MODULE="nano"
@@ -28,6 +28,7 @@ src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${P}-disp.patch
+ epatch "${FILESDIR}"/${P}-crash.patch
}
src_compile() {