21547336 sudo/cd crashes ksh93 because of free(e_dot) in b_cd()
authorTomas Klacko <tomas.klacko@oracle.com>
Mon, 17 Aug 2015 04:10:02 -0700
changeset 4785 87aa2c94d7a5
parent 4784 4b234a26d7fc
child 4786 5d469f31c06d
21547336 sudo/cd crashes ksh93 because of free(e_dot) in b_cd()
components/ksh93/patches/211-21547336.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/211-21547336.patch	Mon Aug 17 04:10:02 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
[email protected]@ -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 '/' */