aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-02-24 17:23:20 -0600
committerJack Nagel2012-02-24 17:29:02 -0600
commita9e6f0773219d40a089ce7dde86900d4e7a9a937 (patch)
tree11971d5aa48bde3374eb16948e24e40de6c6e79c /Library
parentc0299ad19bf14b50c8453eeea6f03eaa2f9bbe6a (diff)
downloadbrew-a9e6f0773219d40a089ce7dde86900d4e7a9a937.tar.bz2
Formula#system: sanitize args before exec
This prevents passing nested arrays to exec; the same thing is done in safe_system. Fixes Homebrew/homebrew#10295. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 453c1082f..2ba8f5762 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -448,6 +448,7 @@ protected
rd.close
$stdout.reopen wr
$stderr.reopen wr
+ args.collect!{|arg| arg.to_s}
exec(cmd, *args) rescue nil
exit! 1 # never gets here unless exec threw or failed
end