diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-12 02:43:36 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-12 02:43:36 +0000 |
commit | 9bfab3c125ed490cbbb838b915420880a59171ad (patch) | |
tree | 6a23169f6bf125298e43ccdb8fc4d2189fdcf8ef /lib | |
parent | 9fbd5955c043489d98419d6c749657e7c6eee30c (diff) |
merge revision(s) 55579: [Backport #12556]
* 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/branches/ruby_2_2@55873 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 5b63764625..c9b80c6804 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -280,6 +280,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 |