File ksh93-crashes.dif of Package ksh

--- src/cmd/ksh93/sh/name.c
+++ src/cmd/ksh93/sh/name.c	2014-05-14 11:00:22.538735546 +0000
@@ -2645,6 +2645,7 @@ void	_nv_unset(register Namval_t *np,int
 				while(stkclose(slp->slptr)==1);
 			else
 				sfclose(slp->slptr);
+			slp->slptr = 0;
 			free((void*)np->nvalue.ip);
 			np->nvalue.ip = 0;
 		}
--- src/cmd/ksh93/sh/parse.c
+++ src/cmd/ksh93/sh/parse.c	2014-04-14 12:24:29.098237738 +0000
@@ -486,11 +486,14 @@
 void sh_funstaks(register struct slnod *slp,int flag)
 {
 	register struct slnod *slpold;
-	while(slpold=slp)
+	while(slp)
 	{
 		if(slp->slchild)
 			sh_funstaks(slp->slchild,flag);
+		slpold = slp;
 		slp = slp->slnext;
+		if (!slpold->slptr)
+			continue;
 		if(flag<=0)
 			stakdelete(slpold->slptr);
 		else