mirror of
https://github.com/sheumann/hush.git
synced 2025-01-30 11:37:02 +00:00
ash: fix segfault in ash.
patch by walter harms <wharms@bfs.de>
This commit is contained in:
parent
d0e70af9d1
commit
5f03158f66
@ -3042,6 +3042,7 @@ expredir(union node *n)
|
|||||||
|
|
||||||
for (redir = n ; redir ; redir = redir->nfile.next) {
|
for (redir = n ; redir ; redir = redir->nfile.next) {
|
||||||
struct arglist fn;
|
struct arglist fn;
|
||||||
|
memset(&fn, 0, sizeof(struct arglist));
|
||||||
fn.lastp = &fn.list;
|
fn.lastp = &fn.list;
|
||||||
switch (redir->type) {
|
switch (redir->type) {
|
||||||
case NFROMTO:
|
case NFROMTO:
|
||||||
@ -3056,7 +3057,10 @@ expredir(union node *n)
|
|||||||
case NTOFD:
|
case NTOFD:
|
||||||
if (redir->ndup.vname) {
|
if (redir->ndup.vname) {
|
||||||
expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user