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 | 534dd1af2af01d267e9201c0bad23de07a20cd29 (patch) | |
tree | 5cc65fa8d8109e5765520b691456ae6d24e5e2cf /lib/net | |
parent | b815fb548297e110225480040f84db1b1f258319 (diff) | |
download | ruby-534dd1af2af01d267e9201c0bad23de07a20cd29.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/net')
-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 |