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

ruby-changes:42930

From: nobu <ko1@a...>
Date: Sun, 15 May 2016 08:21:54 +0900 (JST)
Subject: [ruby-changes:42930] nobu:r55004 (trunk): random.c: clear seed

nobu	2016-05-15 08:21:31 +0900 (Sun, 15 May 2016)

  New Revision: 55004

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55004

  Log:
    random.c: clear seed
    
    * random.c (rand_init): clear packed seed value explicitly.

  Modified files:
    trunk/random.c
Index: random.c
===================================================================
--- random.c	(revision 55003)
+++ random.c	(revision 55004)
@@ -387,6 +387,7 @@ rand_init(struct MT *mt, VALUE seed) https://github.com/ruby/ruby/blob/trunk/random.c#L387
             len--;
         init_by_array(mt, buf, (int)len);
     }
+    explicit_bzero(buf, len * sizeof(*buf));
     if (buf != buf0) xfree(buf);
     return seed;
 }

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

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