summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-18 14:54:40 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-18 14:54:40 +0000
commita9e98cf7d4bf7b551a5b88e0c687b2f58a2f5510 (patch)
treeddaaf0fadf949659a862343843c1765883f12c99 /test
parent6d37aaab9a818754253f546997baa01aa5212d5a (diff)
merge revision(s) 55822: [Backport #12660]
* ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): avoid undefined behavior * test/openssl/test_pair.rb (test_write_zero): new test [ruby-core:76751] [Bug #12660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_pair.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 06ed3836ca..e999d206cf 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -280,6 +280,17 @@ module OpenSSL::TestPairM
}
end
+ def test_write_zero
+ ssl_pair {|s1, s2|
+ assert_equal 0, s2.write_nonblock('', exception: false)
+ assert_kind_of Symbol, s1.read_nonblock(1, exception: false)
+ assert_equal 0, s2.syswrite('')
+ assert_kind_of Symbol, s1.read_nonblock(1, exception: false)
+ assert_equal 0, s2.write('')
+ assert_kind_of Symbol, s1.read_nonblock(1, exception: false)
+ }
+ end
+
def tcp_pair
host = "127.0.0.1"
serv = TCPServer.new(host, 0)