From a69167466afeeccdaf8d4f420d91c91c7a3ee49b Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 31 Jul 2009 09:03:09 +0000 Subject: * lib/securerandom.rb (SecureRandom.random_bytes): return string should be ASCII-8BIT. [ruby-core:24640] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/securerandom.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 4a97ff8a7..e1799c0c0 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -104,7 +104,7 @@ module SecureRandom 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 -- cgit