17851169 ksh93 core dump in sh_assignok() function s11u1-sru 0.175.1.18.0.4.0 S11.1SRU18.4
authorTomas Klacko <tomas.klacko@oracle.com>
Tue, 25 Mar 2014 10:51:42 +0100
branchs11u1-sru
changeset 3011 9265805e77d5
parent 3010 07878573dad3
child 3015 90a75efeb254
17851169 ksh93 core dump in sh_assignok() function
components/ksh93/Makefile
components/ksh93/patches/17851169.patch
--- a/components/ksh93/Makefile	Tue Jan 07 04:04:31 2014 -0800
+++ b/components/ksh93/Makefile	Tue Mar 25 10:51:42 2014 +0100
@@ -76,7 +76,7 @@
 					 Bug15794787,15819673.patch \
 					 Bug15808407.patch Bug17714341.patch \
 					 17432413.patch 17824699.patch \
-					 17435456.patch
+					 17435456.patch 17851169.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/17851169.patch	Tue Mar 25 10:51:42 2014 +0100
@@ -0,0 +1,32 @@
+http://lists.research.att.com/pipermail/ast-developers/2014q1/003809.html
+---
+--- a/src/cmd/ksh93/sh/subshell.c
++++ b/src/cmd/ksh93/sh/subshell.c
[email protected]@ -234,15 +234,22 @@ Namval_t *sh_assignok(register Namval_t *np,int add)
+ {
+ 	register Namval_t	*mp;
+ 	register struct Link	*lp;
+-	register struct subshell *sp = (struct subshell*)subshell_data;
+-	Shell_t			*shp = sp->shp;
+-	Dt_t			*dp= shp->var_tree;
++	register struct subshell *sp;
++	Shell_t			*shp;
++	Dt_t			*dp;
+ 	Namval_t		*mpnext;
+ 	Namarr_t		*ap;
+ 	int			save;
++
++        sp = (struct subshell*)subshell_data;
++
+ 	/* don't bother with this */
+-	if(!sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
++	if(!sp || !sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
+ 		return(np);
++
++	shp = sp->shp;
++	dp = shp->var_tree;
++
+ 	if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np)))
+ 	{
+ 		shp->last_root = ap->table;
+