diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2018-09-04 19:35:41 +0200 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2018-09-04 19:35:41 +0200 |
commit | c65fcb4fd1fa9405b12c2b128b1e8a769b8230c8 (patch) | |
tree | 8ab25fd48290fa77dea1f8f9f03ed7449d8ba445 | |
parent | dc01a92a697c1f5410506afec72a61f4df9ec2fa (diff) |
Avoid crash when redirecting to file descriptor in expredir.
Closes: #861354
-rw-r--r-- | debian/patches/0011-Avoid-crash-when-redirecting-to-file-descriptor-in-e.diff | 34 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/0011-Avoid-crash-when-redirecting-to-file-descriptor-in-e.diff b/debian/patches/0011-Avoid-crash-when-redirecting-to-file-descriptor-in-e.diff new file mode 100644 index 0000000..01f707d --- /dev/null +++ b/debian/patches/0011-Avoid-crash-when-redirecting-to-file-descriptor-in-e.diff @@ -0,0 +1,34 @@ +From 98c530c23d9a7f86c996b028cadc2f685ec1b339 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu@mailbox.org> +Date: Sat, 6 May 2017 10:40:37 +0200 +Subject: Avoid crash when redirecting to file descriptor in expredir. + +https://bugs.debian.org/861354 +--- + src/eval.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/eval.c b/src/eval.c +index 3c47b59..61440e1 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -493,6 +493,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: +@@ -507,6 +508,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; +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index 6c20a6d..f760c7f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,5 +5,6 @@ 0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff 0008-Support-e-in-echo-and-printf-builtins.diff 0010-Hardcode-mktemp.diff +0011-Avoid-crash-when-redirecting-to-file-descriptor-in-e.diff 9001-Add-privmode-Part-1.diff 9002-Add-privmode-Part-2.diff |