summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/securerandom.rb2
-rw-r--r--version.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 47e04290b2..7daa4d1df9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 31 18:01:34 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/securerandom.rb (SecureRandom.random_bytes): return string should
+ be ASCII-8BIT. [ruby-core:24640]
+
Fri Jul 31 10:54:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (literal_concat_gen): reduced unnecessary node at string
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 0de118cb44..0f7c05bc92 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
diff --git a/version.h b/version.h
index 7eff4f75c0..9056fcccba 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 259
+#define RUBY_PATCHLEVEL 260
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1