From f8a9bbd3ecb2817bf9a98e2e80d2be79ad7c55ca Mon Sep 17 00:00:00 2001 From: shugo Date: Tue, 5 Jul 2016 22:14:18 +0000 Subject: * 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 --- lib/net/ftp.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/net') 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 -- cgit v1.2.3