Blame SOURCES/ksh-20120801-covsfix.patch

61d8f4
diff -up ksh-20120801/src/cmd/ksh93/sh/init.c.covsfix ksh-20120801/src/cmd/ksh93/sh/init.c
61d8f4
--- ksh-20120801/src/cmd/ksh93/sh/init.c.covsfix	2013-07-22 17:41:34.674054068 +0200
61d8f4
+++ ksh-20120801/src/cmd/ksh93/sh/init.c	2013-07-22 17:42:50.761361921 +0200
61d8f4
@@ -1237,9 +1237,11 @@ static void put_mode(Namval_t* np, const
61d8f4
 				mode = *(double*)val;
61d8f4
 		}
61d8f4
 		else
61d8f4
+		{
61d8f4
 			mode = strperm(val, &last,0);
61d8f4
-		if(*last)
61d8f4
-			errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
61d8f4
+			if(*last)
61d8f4
+				errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
61d8f4
+		}
61d8f4
 		nv_putv(np,(char*)&mode,NV_INTEGER,nfp);
61d8f4
 	}
61d8f4
 	else
61d8f4
diff -up ksh-20120801/src/cmd/ksh93/sh/io.c.covsfix ksh-20120801/src/cmd/ksh93/sh/io.c
61d8f4
--- ksh-20120801/src/cmd/ksh93/sh/io.c.covsfix	2013-07-22 17:06:30.282927080 +0200
61d8f4
+++ ksh-20120801/src/cmd/ksh93/sh/io.c	2013-07-22 17:08:49.645721280 +0200
61d8f4
@@ -954,6 +954,7 @@ int	sh_pipe(register int pv[])
61d8f4
 	socklen_t		slen;
61d8f4
 	if ((pv[out] = socket (AF_INET, SOCK_STREAM, 0)) < 0)
61d8f4
 		errormsg(SH_DICT,ERROR_system(1),e_pipe);
61d8f4
+	memset(&sin.sin_zero, 0, sizeof(sin.sin_zero));
61d8f4
 	do
61d8f4
 	{
61d8f4
 		sin.sin_family = AF_INET;
61d8f4
diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.covsfix ksh-20120801/src/cmd/ksh93/sh/name.c
61d8f4
--- ksh-20120801/src/cmd/ksh93/sh/name.c.covsfix	2013-07-22 17:40:31.644635604 +0200
61d8f4
+++ ksh-20120801/src/cmd/ksh93/sh/name.c	2013-07-22 17:41:15.828227073 +0200
61d8f4
@@ -3094,6 +3094,7 @@ void nv_newattr (register Namval_t *np,
61d8f4
 			if(!mp)
61d8f4
 				nv_putval (np, cp, NV_RDONLY);
61d8f4
 			free(cp);
61d8f4
+			cp = NULL;
61d8f4
 		}
61d8f4
 	}
61d8f4
 	while(ap && nv_nextsub(np));
61d8f4
diff -up ksh-20120801/src/cmd/ksh93/sh/subshell.c.covsfix ksh-20120801/src/cmd/ksh93/sh/subshell.c
61d8f4
--- ksh-20120801/src/cmd/ksh93/sh/subshell.c.covsfix	2013-07-22 17:46:15.607533423 +0200
61d8f4
+++ ksh-20120801/src/cmd/ksh93/sh/subshell.c	2013-07-22 17:48:36.739290968 +0200
61d8f4
@@ -205,7 +205,14 @@ void sh_subfork(void)
61d8f4
 		shp->comsub = 0;
61d8f4
 		SH_SUBSHELLNOD->nvalue.s = 0;
61d8f4
 		sp->subpid=0;
61d8f4
-		shp->st.trapcom[0] = (comsub==2?NULL:trap);
61d8f4
+		if (comsub==2)
61d8f4
+		{
61d8f4
+			shp->st.trapcom[0] = NULL;
61d8f4
+			if(trap)
61d8f4
+				free((void*)trap);
61d8f4
+		}
61d8f4
+		else
61d8f4
+			shp->st.trapcom[0] = (comsub==2?NULL:trap);
61d8f4
 		shp->savesig = 0;
61d8f4
 	}
61d8f4
 }