1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/net/ftp/test_ftp.rb (process_port_or_eprt): merge a part of

r56973 to pass the test introduced at previous commit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@61255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2017-12-14 15:08:49 +00:00
parent 0207c68ea3
commit 02b8978ff1
3 changed files with 26 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Fri Dec 15 00:08:26 2017 NAKAMURA Usaku <usa@ruby-lang.org>
* test/net/ftp/test_ftp.rb (process_port_or_eprt): merge a part of
r56973 to pass the test introduced at previous commit.
Thu Dec 14 22:52:11 2017 Shugo Maeda <shugo@ruby-lang.org>
Fix a command injection vulnerability in Net::FTP.

View file

@ -1081,4 +1081,22 @@ EOF
end
end
end
def process_port_or_eprt(sock, line)
case line
when /\APORT (.*)/
port_args = $1.split(/,/)
host = port_args[0, 4].join(".")
port = port_args[4, 2].map(&:to_i).inject {|x, y| (x << 8) + y}
sock.print("200 PORT command successful.\r\n")
return host, port
when /\AEPRT \|2\|(.*?)\|(.*?)\|/
host = $1
port = $2.to_i
sock.print("200 EPRT command successful.\r\n")
return host, port
else
flunk "PORT or EPRT expected"
end
end
end

View file

@ -1,10 +1,10 @@
#define RUBY_VERSION "2.2.9"
#define RUBY_RELEASE_DATE "2017-12-14"
#define RUBY_PATCHLEVEL 479
#define RUBY_RELEASE_DATE "2017-12-15"
#define RUBY_PATCHLEVEL 480
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 12
#define RUBY_RELEASE_DAY 14
#define RUBY_RELEASE_DAY 15
#include "ruby/version.h"