Skip to content

Commit d3be113

Browse files
authored
Merge pull request #465 from tfutils/fix/455-double-quoted-trap
Fix #455: Double-quoted trap in tfenv-install vulnerable to path injection
2 parents 5eceac2 + 1185985 commit d3be113

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libexec/tfenv-install

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ fi;
170170
download_tmp="$(mktemp -d ${tmpdir_arg} tfenv_download.XXXXXX)" || log 'error' "Unable to create temporary download directory (mktemp -d ${tmpdir_arg} tfenv_download.XXXXXX). Working Directory is: $(pwd)";
171171

172172
# Clean it up in case of error
173-
trap "rm -rf ${download_tmp}" EXIT;
173+
cleanup_download() { rm -rf "${download_tmp}"; }
174+
trap cleanup_download EXIT;
174175

175176
declare curl_progress="";
176177
case "${TFENV_CURL_OUTPUT:-2}" in

0 commit comments

Comments
 (0)