[前][次][番号順一覧][スレッド一覧]

ruby-changes:44812

From: shugo <ko1@a...>
Date: Thu, 24 Nov 2016 00:10:24 +0900 (JST)
Subject: [ruby-changes:44812] shugo:r56885 (trunk): Add CR/LF check to Net::FTP#status.

shugo	2016-11-24 00:10:19 +0900 (Thu, 24 Nov 2016)

  New Revision: 56885

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56885

  Log:
    Add CR/LF check to Net::FTP#status.

  Modified files:
    trunk/lib/net/ftp.rb
Index: lib/net/ftp.rb
===================================================================
--- lib/net/ftp.rb	(revision 56884)
+++ lib/net/ftp.rb	(revision 56885)
@@ -1231,6 +1231,9 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L1231
     #
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]