diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 13:55:41 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 13:55:41 +0000 |
commit | 1cfe43fd85c66a9e2b5068480b3e043c31e6b8ca (patch) | |
tree | fca9d3c2509ef2ef41c5b3d9395cb2e23e45dd42 /lib | |
parent | ccbe964c1f5ecb54a21473bd27f255ee12120fdf (diff) |
merge revision(s) 61242: [Backport #14185]
Fix a command injection vulnerability in Net::FTP.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@61248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index bd89956d36..0437e9504e 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -622,10 +622,10 @@ module Net if localfile if @resume rest_offset = File.size?(localfile) - f = open(localfile, "a") + f = File.open(localfile, "a") else rest_offset = nil - f = open(localfile, "w") + f = File.open(localfile, "w") end elsif !block_given? result = String.new @@ -655,7 +655,7 @@ module Net f = nil result = nil if localfile - f = open(localfile, "w") + f = File.open(localfile, "w") elsif !block_given? result = String.new end @@ -701,7 +701,7 @@ module Net else rest_offset = nil end - f = open(localfile) + f = File.open(localfile) begin f.binmode if rest_offset @@ -720,7 +720,7 @@ module Net # passing in the transmitted data one line at a time. # def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line - f = open(localfile) + f = File.open(localfile) begin storlines("STOR #{remotefile}", f, &block) ensure |