summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoremboss <emboss@ruby-lang.org>2011-10-19 20:05:21 +0000
committeremboss <emboss@ruby-lang.org>2011-10-19 20:05:21 +0000
commit8b041147b9694431e4dcc6cc2b66d46caac89f12 (patch)
treeb065867cf9171c9bc045076cca2a673f97fe3e4c /lib
parentcc5b6e068f22b6a73c546b51ee7ed6ae148e4d8e (diff)
downloadruby-openssl-history-8b041147b9694431e4dcc6cc2b66d46caac89f12.tar.gz
* 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/trunk@33485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/openssl/buffering.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb
index eb39dab..51bc968 100644
--- a/lib/openssl/buffering.rb
+++ b/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
##