I've just submitted this to the tcsh mantis but since it is a crasher
that bites me often, I think it makes sense to fix it in the port
too.

Full details at:
    http://bugs.gw.com/view.php?id=412

 - todd

Index: shells/tcsh/Makefile
===================================================================
RCS file: /cvs/ports/shells/tcsh/Makefile,v
retrieving revision 1.51
diff -u -r1.51 Makefile
--- shells/tcsh/Makefile        11 Mar 2013 11:41:29 -0000      1.51
+++ shells/tcsh/Makefile        6 Jan 2015 21:34:44 -0000
@@ -3,7 +3,7 @@
 COMMENT=       extended C-shell with many useful features
 
 DISTNAME=      tcsh-6.18.01
-REVISION=      0
+REVISION=      1
 CATEGORIES=    shells
 HOMEPAGE=      http://www.tcsh.org/
 
Index: shells/tcsh/patches/patch-ed_refresh_c
===================================================================
RCS file: shells/tcsh/patches/patch-ed_refresh_c
diff -N shells/tcsh/patches/patch-ed_refresh_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ shells/tcsh/patches/patch-ed_refresh_c      6 Jan 2015 21:59:46 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Fix out of bounds crash in emacs mode when erasing long lines.
+See http://bugs.gw.com/view.php?id=412
+
+--- ed.refresh.c.orig  Tue Jan  6 14:30:14 2015
++++ ed.refresh.c       Tue Jan  6 14:26:58 2015
+@@ -1299,7 +1299,7 @@ ClearDisp(void)
+     CursorV = 0;              /* clear the display buffer */
+     CursorH = 0;
+     for (i = 0; i < TermV; i++)
+-      (void) memset(Display[i], 0, TermH * sizeof(Display[0][0]));
++      (void) memset(Display[i], 0, (TermH + 1) * sizeof(Display[0][0]));
+     OldvcV = 0;
+     litlen = 0;
+ }

Reply via email to