diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-23 15:10:19 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-23 15:10:19 +0000 |
commit | ae40b481e7c1a818352a694e515f3c1841eaff7a (patch) | |
tree | 5cc65fa8d8109e5765520b691456ae6d24e5e2cf /lib | |
parent | e6efdb7bfd39ce1de06c8a2a3f560ff28f610dfc (diff) | |
download | ruby-ae40b481e7c1a818352a694e515f3c1841eaff7a.tar.gz |
Add CR/LF check to Net::FTP#status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index d33085331c..7aac61afe8 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1231,6 +1231,9 @@ module Net # def status(pathname = nil) line = pathname ? "STAT #{pathname}" : "STAT" + if /[\r\n]/ =~ line + raise ArgumentError, "A line must not contain CR or LF" + end print "put: #{line}\n" if @debug_mode @sock.send(line + CRLF, Socket::MSG_OOB) return getresp |