summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb3
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