summaryrefslogtreecommitdiff
path: root/inits.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-20 02:46:17 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-20 02:46:17 +0000
commit04739ba61744046ac145b384aa9053429c80142f (patch)
tree848a727b1a400b56d7906f33ad564d8073aaf693 /inits.c
parent3af6dda231c26524b65a02f8212d91ce37618aa9 (diff)
downloadruby-04739ba61744046ac145b384aa9053429c80142f.tar.gz
* string.c (rb_memhash): randomize hash to avoid algorithmic
complexity attacks. (rb_str_hash): use rb_memhash. * include/ruby/intern.h (rb_reset_random_seed): declared. * thread.c (rb_thread_atfork): call rb_reset_random_seed. * inits.c (rb_call_inits): call Init_RandomSeed at first. * random.c (seed_initialized): defined. (fill_random_seed): extracted from random_seed. (make_seed_value): extracted from random_seed. (rb_f_rand): initialize random seed at first. (initial_seed): defined. (Init_RandomSeed): defined. (Init_RandomSeed2): defined. (rb_reset_random_seed): defined. (Init_Random): call Init_RandomSeed2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'inits.c')
-rw-r--r--inits.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/inits.c b/inits.c
index d031fcf08f..5e55d7f69d 100644
--- a/inits.c
+++ b/inits.c
@@ -38,6 +38,7 @@ void Init_Precision(void);
void Init_sym(void);
void Init_id(void);
void Init_process(void);
+void Init_RandomSeed(void);
void Init_Random(void);
void Init_Range(void);
void Init_Rational(void);
@@ -58,6 +59,7 @@ void Init_Encoding(void);
void
rb_call_inits()
{
+ Init_RandomSeed();
Init_sym();
Init_id();
Init_var_tables();