mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
e6efdb7bfd
commit
ae40b481e7
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue