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

ruby-changes:12628

From: usa <ko1@a...>
Date: Fri, 31 Jul 2009 18:03:31 +0900 (JST)
Subject: [ruby-changes:12628] Ruby:r24341 (trunk): * lib/securerandom.rb (SecureRandom.random_bytes): return string should

usa	2009-07-31 18:03:09 +0900 (Fri, 31 Jul 2009)

  New Revision: 24341

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24341

  Log:
    * lib/securerandom.rb (SecureRandom.random_bytes): return string should
      be ASCII-8BIT.  [ruby-core:24640]

  Modified files:
    trunk/ChangeLog
    trunk/lib/securerandom.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24340)
+++ ChangeLog	(revision 24341)
@@ -1,3 +1,8 @@
+Fri Jul 31 18:01:34 2009  NAKAMURA Usaku  <usa@r...>
+
+	* lib/securerandom.rb (SecureRandom.random_bytes): return string should
+	  be ASCII-8BIT.  [ruby-core:24640]
+
 Fri Jul 31 16:28:33 2009  NARUSE, Yui  <naruse@r...>
 
 	* io.c (rb_stdio_set_default_encoding): added.
Index: lib/securerandom.rb
===================================================================
--- lib/securerandom.rb	(revision 24340)
+++ lib/securerandom.rb	(revision 24341)
@@ -104,7 +104,7 @@
       end
     end
     if @has_win32
-      bytes = " " * n
+      bytes = " ".force_encoding("ASCII-8BIT") * n
       if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
         raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
       end

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

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