17824699 ksh93 coredumps in ed_emacsread() when changing prompt string (PS1)
authorTomas Klacko <tomas.klacko@oracle.com>
Tue, 07 Jan 2014 05:15:45 -0800
changeset 1622 72f10d7bcda6
parent 1621 e58b809ee5f8
child 1623 d468c2c1e73d
17824699 ksh93 coredumps in ed_emacsread() when changing prompt string (PS1)
components/ksh93/Makefile
components/ksh93/patches/17824699.patch
--- a/components/ksh93/Makefile	Tue Jan 07 04:04:31 2014 -0800
+++ b/components/ksh93/Makefile	Tue Jan 07 05:15:45 2014 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -78,7 +78,7 @@
 					 CR7186440_ksh93_disable_predictive_editing.patch \
 					 CR7128313.patch  Bug15794787,15819673.patch \
 					 Bug15808407.patch Bug17714341.patch \
-					 17432413.patch
+					 17432413.patch 17824699.patch
 
 # Fixup HOSTTYPE to match uname output and bits
 HOSTTYPE32=sol11.$(shell uname -p)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/17824699.patch	Tue Jan 07 05:15:45 2014 -0800
@@ -0,0 +1,30 @@
+http://lists.research.att.com/pipermail/ast-developers/2014q1/003807.html
+---
+diff --git a/src/cmd/ksh93/edit/edit.c b/src/cmd/ksh93/edit/edit.c
+index 769ba2e..4f6330e 100644
+--- a/src/cmd/ksh93/edit/edit.c
++++ b/src/cmd/ksh93/edit/edit.c
[email protected]@ -651,7 +651,8 @@ void	ed_setup(register Edit_t *ep, int fd, int reedit)
+ 			{
+ 				int skip=0;
+ 				ep->e_crlf = 0;
+-				*pp++ = c;
++				if (pp < ppmax)
++					*pp++ = c;
+ 				for(n=1; c = *last++; n++)
+ 				{
+ 					if(pp < ppmax)
+diff --git a/src/cmd/ksh93/include/edit.h b/src/cmd/ksh93/include/edit.h
+index 795777d..145066d 100644
+--- a/src/cmd/ksh93/include/edit.h
++++ b/src/cmd/ksh93/include/edit.h
[email protected]@ -59,7 +59,7 @@
+ #endif /* SHOPT_MULTIBYTE */
+ 
+ #define TABSIZE	8
+-#define PRSIZE	160
++#define PRSIZE	256
+ #define MAXLINE	1024		/* longest edit line permitted */
+ 
+ typedef struct _edit_pos
+