diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-05 22:14:18 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-05 22:14:18 +0000 |
commit | 34a0e098f7b5cf4fbceb5e9ef254557787a27fff (patch) | |
tree | 566b104ef15f60520331826fd5312234a676dbfe /lib/net/ftp.rb | |
parent | b0087b178e9a588c7afef9025447892710ce4a0d (diff) |
* lib/net/ftp.rb (putline): raise an ArgumentError when
CR or LF is included in a line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/ftp.rb')
-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 cfd8cf7945..bd89956d36 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -295,6 +295,9 @@ module Net if @debug_mode print "put: ", sanitize(line), "\n" end + if /[\r\n]/ =~ line + raise ArgumentError, "A line must not contain CR or LF" + end line = line + CRLF @sock.write(line) end |