From 2c5d6bae4d62e654e841468f1b1c2318439958d6 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 10 Feb 2012 17:27:22 +0000 Subject: merge revision(s) 33485: * lib/openssl/buffering.rb: Force multi-byte strings to be treated as binary data. * test/openssl/test_ssl.rb: Add test for it. Thanks to Niklas Baumstark for reporting the issue! [Ruby 1.9 - Bug #5233] [ruby-core:39120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/lib/openssl/buffering.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb index eb39dabcef..51bc968e3a 100644 --- a/ext/openssl/lib/openssl/buffering.rb +++ b/ext/openssl/lib/openssl/buffering.rb @@ -307,6 +307,7 @@ module OpenSSL::Buffering def do_write(s) @wbuffer = "" unless defined? @wbuffer @wbuffer << s + @wbuffer.force_encoding(Encoding::BINARY) @sync ||= false if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/) remain = idx ? idx + $/.size : @wbuffer.length @@ -333,7 +334,7 @@ module OpenSSL::Buffering def write(s) do_write(s) - s.length + s.bytesize end ## -- cgit v1.2.3