mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
* test/openssl/test_engine.rb: Add a test for it. Thanks to Ippei Obayashi for providing the patch. [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
480c0f69bd
commit
84e835fe4a
3 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Fri Jul 22 09:09:43 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
|
||||||
|
* test/openssl/test_engine.rb: Add a test for it.
|
||||||
|
Thanks to Ippei Obayashi for providing the patch.
|
||||||
|
[ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]
|
||||||
|
|
||||||
Fri Jul 22 06:37:13 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Fri Jul 22 06:37:13 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
|
* lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
|
||||||
|
|
|
@ -115,7 +115,11 @@ ossl_engine_s_engines(VALUE klass)
|
||||||
|
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)){
|
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)){
|
||||||
WrapEngine(klass, obj, e);
|
/* Need a ref count of two here because of ENGINE_free being
|
||||||
|
* called internally by OpenSSL when moving to the next ENGINE
|
||||||
|
* and by us when releasing the ENGINE reference */
|
||||||
|
ENGINE_up_ref(e);
|
||||||
|
WrapEngine(klass, obj, e);
|
||||||
rb_ary_push(ary, obj);
|
rb_ary_push(ary, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
test/openssl/test_engine.rb
Normal file
15
test/openssl/test_engine.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require_relative 'utils'
|
||||||
|
|
||||||
|
if defined?(OpenSSL)
|
||||||
|
|
||||||
|
class OpenSSL::TestEngine < Test::Unit::TestCase
|
||||||
|
|
||||||
|
def test_engines_free # [ruby-dev:44173]
|
||||||
|
OpenSSL::Engine.load
|
||||||
|
OpenSSL::Engine.engines
|
||||||
|
OpenSSL::Engine.engines
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue