[4513] MacRuby/trunk/ext/openssl/ossl_rand.c
Revision: 4513 http://trac.macosforge.org/projects/ruby/changeset/4513 Author: lsansonetti@apple.com Date: 2010-09-13 21:40:27 -0700 (Mon, 13 Sep 2010) Log Message: ----------- omg another openssl crasher Modified Paths: -------------- MacRuby/trunk/ext/openssl/ossl_rand.c Modified: MacRuby/trunk/ext/openssl/ossl_rand.c =================================================================== --- MacRuby/trunk/ext/openssl/ossl_rand.c 2010-09-14 01:28:43 UTC (rev 4512) +++ MacRuby/trunk/ext/openssl/ossl_rand.c 2010-09-14 04:40:27 UTC (rev 4513) @@ -120,8 +120,9 @@ VALUE str; int n = NUM2INT(len); - str = rb_str_new(0, n); - if (!RAND_pseudo_bytes((unsigned char *)RSTRING_PTR(str), n)) { + str = rb_bstr_new(); + rb_bstr_resize(str, n); + if (!RAND_pseudo_bytes((unsigned char *)rb_bstr_bytes(str), n)) { ossl_raise(eRandomError, NULL); }
participants (1)
-
source_changes@macosforge.org