summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:30:55 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:30:55 +0000
commitf0fc0463564b9d8f9c22e1c82c998646e930422f (patch)
treeb9fc0318affed27f8e1ddb69efa0388b9d0403e2 /lib
parent3e2f55070825f8e21d9727deca6d1e90d0e36187 (diff)
merges r24341 from trunk into ruby_1_9_1.
-- * 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/branches/ruby_1_9_1@24455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/securerandom.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 0de118cb4..0f7c05bc9 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -99,7 +99,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