diff options
author | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2017-08-20 15:16:18 +0900 |
---|---|---|
committer | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2017-08-21 00:50:32 +0900 |
commit | ecd1bea43731f11116925bb6805a9a135a996f11 (patch) | |
tree | 8ae3fa550fa56079e6b118a6bdeb9ff4da09efeb /lib | |
parent | aea4046b5b91b83b27f117822e1bd6c614da3e6e (diff) | |
download | bundler-ecd1bea43731f11116925bb6805a9a135a996f11.tar.gz |
avoid TOPLEVEL_BINDING pollution
Evaluating user inputs in the TOPLEVEL_BINDING can pollute global
toplevel local variable namespace because there is only one
TOPLEVEL_BINDING across the entire process. Here in this method
we do not need such thing. Duplicating that binding to create
dedicated one for this purpose should effectively kill such global
side effects.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index e4b9313401..57b4c32e40 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -494,7 +494,7 @@ EOF end def eval_gemspec(path, contents) - eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s) + eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s) rescue ScriptError, StandardError => e msg = "There was an error while loading `#{path.basename}`: #{e.message}" |