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
@ -1231,6 +1231,9 @@ module Net
|
|||||||
#
|
#
|
||||||
def status(pathname = nil)
|
def status(pathname = nil)
|
||||||
line = pathname ? "STAT #{pathname}" : "STAT"
|
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
|
print "put: #{line}\n" if @debug_mode
|
||||||
@sock.send(line + CRLF, Socket::MSG_OOB)
|
@sock.send(line + CRLF, Socket::MSG_OOB)
|
||||||
return getresp
|
return getresp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user