Message ID | 20180907083414.14673-5-andrew.shadura@collabora.co.uk (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Herbert Xu |
Headers | show |
Series | [1/6] exec: Don't execute binary files if execve() returned ENOEXEC. | expand |
diff --git a/src/eval.c b/src/eval.c index 6185db4..ee43fa9 100644 --- a/src/eval.c +++ b/src/eval.c @@ -516,6 +516,7 @@ expredir(union node *n) for (redir = n ; redir ; redir = redir->nfile.next) { struct arglist fn; + fn.list = NULL; fn.lastp = &fn.list; switch (redir->type) { case NFROMTO: @@ -530,6 +531,8 @@ expredir(union node *n) case NTOFD: if (redir->ndup.vname) { expandarg(redir->ndup.vname, &fn, EXP_FULL | EXP_TILDE); + if (!fn.list) + sh_error("ambiguous redirect"); fixredir(redir, fn.list->text, 1); } break;