svn commit: trunk/busybox/shell

vda at busybox.net vda at busybox.net
Sun Oct 15 18:33:18 PDT 2006


Author: vda
Date: 2006-10-15 18:33:16 -0700 (Sun, 15 Oct 2006)
New Revision: 16394

Log:
ash: fix segfault in ash.
patch by walter harms <wharms at bfs.de>


Modified:
   trunk/busybox/shell/ash.c


Changeset:
Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2006-10-16 01:10:28 UTC (rev 16393)
+++ trunk/busybox/shell/ash.c	2006-10-16 01:33:16 UTC (rev 16394)
@@ -3042,6 +3042,7 @@
 
 	for (redir = n ; redir ; redir = redir->nfile.next) {
 		struct arglist fn;
+		memset(&fn, 0, sizeof(struct arglist));
 		fn.lastp = &fn.list;
 		switch (redir->type) {
 		case NFROMTO:
@@ -3056,7 +3057,10 @@
 		case NTOFD:
 			if (redir->ndup.vname) {
 				expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE);
-				fixredir(redir, fn.list->text, 1);
+				if (fn.list != NULL)
+					fixredir(redir, fn.list->text, 1);
+				else
+					sh_error("redir error");
 			}
 			break;
 		}



More information about the busybox-cvs mailing list