From: Akinori MUSHA Date: 2008-05-30T02:47:01+09:00 Subject: [ruby-dev:34891] Re: OpenSSL::Random.random_bytes(Object.new) --pgp-sign-Multipart_Fri_May_30_02:47:11_2008-1 Content-Type: text/plain; charset=ISO-2022-JP At Fri, 30 May 2008 01:55:43 +0900, Tanaka Akira wrote: > 以下のように、 OpenSSL::Random.random_bytes(Object.new) で > negative string size (or size too big) (ArgumentError) > という例外になるのは変なのではないでしょうか。 > > % ./ruby -ropenssl -ve 'p OpenSSL::Random.random_bytes(Object.new)' > ruby 1.8.7 (2008-05-28 patchlevel 5000) [i686-linux] > -e:1:in `random_bytes': negative string size (or size too big) (ArgumentError) > from -e:1  FIXNUM_P()でチェックせずにFIX2INT()しているのが問題でした。 ほかにもいくつかあったので併せて直しました。 -- Akinori MUSHA / http://akinori.org/ --pgp-sign-Multipart_Fri_May_30_02:47:11_2008-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkg+7B8ACgkQkgvvx5/Z4e40gQCglWM1iw9JeSpjPI6GTvvshvHA yNAAnjICVVaZ5zIVo2WhPPpvS1/6ePW5 =bKR0 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Fri_May_30_02:47:11_2008-1--