21547336 sudo/cd crashes ksh93 because of free(e_dot) in b_cd() s11u3-sru
authorTomas Klacko <tomas.klacko@oracle.com>
Fri, 09 Oct 2015 03:26:04 -0700
branchs11u3-sru
changeset 4931 d1cee1a4499d
parent 4930 b6f4cd2a91cf
child 4932 9ace63b409d6
21547336 sudo/cd crashes ksh93 because of free(e_dot) in b_cd()
components/ksh93/Makefile
components/ksh93/patches/21547336.patch
--- a/components/ksh93/Makefile	Fri Oct 09 03:15:31 2015 -0700
+++ b/components/ksh93/Makefile	Fri Oct 09 03:26:04 2015 -0700
@@ -81,7 +81,7 @@
 					 Bug15808407.patch Bug17714341.patch \
 					 17432413.patch 17824699.patch \
 					 17435456.patch 17851169.patch \
-					 Bug15993811.patch
+					 Bug15993811.patch 21547336.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/21547336.patch	Fri Oct 09 03:26:04 2015 -0700
@@ -0,0 +1,16 @@
+http://lists.research.att.com/pipermail/ast-developers/2015q3.txt
+Message-ID: <[email protected]>
+
+diff --git a/src/cmd/ksh93/bltins/cd_pwd.c b/src/cmd/ksh93/bltins/cd_pwd.c
+index 0735be9..ed544bf 100644
+--- a/src/cmd/ksh93/bltins/cd_pwd.c
++++ b/src/cmd/ksh93/bltins/cd_pwd.c
+@@ -191,7 +191,7 @@ success:
+ 	if(*dir != '/')
+ 		return(0);
+ 	nv_putval(opwdnod,oldpwd,NV_RDONLY);
+-	if(oldpwd)
++	if(oldpwd && (oldpwd!=e_dot))
+ 		free(oldpwd);
+ 	flag = strlen(dir);
+ 	/* delete trailing '/' */