ruby-changes:16627
From: nahi <ko1@a...>
Date: Mon, 12 Jul 2010 22:33:00 +0900 (JST)
Subject: [ruby-changes:16627] Ruby:r28621 (ruby_1_8): * ext/openssl/ossl_config.c (ossl_config_copy): wrongly updating the
nahi 2010-07-12 22:32:49 +0900 (Mon, 12 Jul 2010) New Revision: 28621 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28621 Log: * ext/openssl/ossl_config.c (ossl_config_copy): wrongly updating the given object with uninitialized CONF data. now OpenSSL::Config#clone works as expected; cloning the config instead of SEGV or empty definition. * test/openssl/test_config.rb: added tests for Config#clone. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/ext/openssl/ossl_config.c branches/ruby_1_8/test/openssl/test_config.rb Index: ruby_1_8/ext/openssl/ossl_config.c =================================================================== --- ruby_1_8/ext/openssl/ossl_config.c (revision 28620) +++ ruby_1_8/ext/openssl/ossl_config.c (revision 28621) @@ -119,8 +119,8 @@ VALUE str; CONF *conf; - str = rb_funcall(self, rb_intern("to_s"), 0); - GetConfig(other, conf); + str = rb_funcall(other, rb_intern("to_s"), 0); + GetConfig(self, conf); parse_config(str, conf); return self; Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 28620) +++ ruby_1_8/ChangeLog (revision 28621) @@ -1,3 +1,12 @@ +Mon Jul 12 22:26:00 2010 NAKAMURA, Hiroshi <nahi@r...> + + * ext/openssl/ossl_config.c (ossl_config_copy): wrongly updating the + given object with uninitialized CONF data. now + OpenSSL::Config#clone works as expected; cloning the config instead of + SEGV or empty definition. + + * test/openssl/test_config.rb: added tests for Config#clone. + Sat Jul 10 10:51:29 2010 KOSAKI Motohiro <kosaki.motohiro@g...> * configure.in: fix use_context condition inversion. Index: ruby_1_8/test/openssl/test_config.rb =================================================================== --- ruby_1_8/test/openssl/test_config.rb (revision 28620) +++ ruby_1_8/test/openssl/test_config.rb (revision 28621) @@ -271,4 +271,16 @@ c['foo'] = [['key', 'wrong']] end end + + def test_dup + assert(!@it.sections.empty?) + c = @it.dup + assert_equal(@it.sections.sort, c.sections.sort) + end + + def test_clone + assert(!@it.sections.empty?) + c = @it.clone + assert_equal(@it.sections.sort, c.sections.sort) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/