summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-16 01:33:16 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-16 01:33:16 +0000
commit5f03158f66dc2c73b052307f3871c4341fbabb8e (patch)
tree5500d4ec05d4c3c63f90a86fd227fc5870403213 /shell
parentd0e70af9d1065400a3ed478393dcd3873d1cb7d8 (diff)
downloadbusybox-w32-5f03158f66dc2c73b052307f3871c4341fbabb8e.tar.gz
busybox-w32-5f03158f66dc2c73b052307f3871c4341fbabb8e.tar.bz2
busybox-w32-5f03158f66dc2c73b052307f3871c4341fbabb8e.zip
ash: fix segfault in ash.
patch by walter harms <wharms@bfs.de>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 1260d5e9a..a34c871f1 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3042,6 +3042,7 @@ expredir(union node *n)
3042 3042
3043 for (redir = n ; redir ; redir = redir->nfile.next) { 3043 for (redir = n ; redir ; redir = redir->nfile.next) {
3044 struct arglist fn; 3044 struct arglist fn;
3045 memset(&fn, 0, sizeof(struct arglist));
3045 fn.lastp = &fn.list; 3046 fn.lastp = &fn.list;
3046 switch (redir->type) { 3047 switch (redir->type) {
3047 case NFROMTO: 3048 case NFROMTO:
@@ -3056,7 +3057,10 @@ expredir(union node *n)
3056 case NTOFD: 3057 case NTOFD:
3057 if (redir->ndup.vname) { 3058 if (redir->ndup.vname) {
3058 expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE); 3059 expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE);
3059 fixredir(redir, fn.list->text, 1); 3060 if (fn.list != NULL)
3061 fixredir(redir, fn.list->text, 1);
3062 else
3063 sh_error("redir error");
3060 } 3064 }
3061 break; 3065 break;
3062 } 3066 }