1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
normal 7513d54659 openssl: avoid undefined behavior on empty SSL_write
SSL_write(3ssl) manpage has this in the WARNINGS section:

       When calling SSL_write() with num=0 bytes to be sent the
       behaviour is undefined.

And indeed, the new test case demonstrates failures when
empty strings are used.  So, match the behavior of IO#write,
IO#write_nonblock, and IO#syswrite by returning zero, as the
OpenSSL::SSL::SSLSocket API already closely mimics the IO one.

* 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/trunk@55822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-06 21:50:10 +00:00
..
-test- rb_funcallv 2016-07-29 11:57:14 +00:00
bigdecimal Integer conversion 2016-06-18 02:25:28 +00:00
cgi/escape Update dependencies 2016-07-06 05:48:13 +00:00
continuation Update dependencies 2016-07-06 05:48:13 +00:00
coverage Update dependencies. 2016-04-11 11:50:00 +00:00
date Update dependencies 2016-07-06 05:48:13 +00:00
dbm Update dependencies 2016-07-06 05:48:13 +00:00
digest rb_funcallv 2016-07-29 11:57:14 +00:00
etc Update dependencies 2016-07-06 05:48:13 +00:00
fcntl Update dependencies 2016-07-06 05:48:13 +00:00
fiber Update dependencies 2016-07-06 05:48:13 +00:00
fiddle Update dependencies 2016-07-06 05:48:13 +00:00
gdbm Update dependencies 2016-07-06 05:48:13 +00:00
io Update dependencies 2016-07-06 05:48:13 +00:00
json * ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2. 2016-08-01 03:16:30 +00:00
mathn handle ext/ as r53141 2015-12-16 05:31:54 +00:00
nkf Update dependencies. 2016-04-11 11:50:00 +00:00
objspace ObjectSpace.dump_all: valid JSON 2016-06-11 05:04:22 +00:00
openssl openssl: avoid undefined behavior on empty SSL_write 2016-08-06 21:50:10 +00:00
pathname rb_funcallv 2016-07-29 11:57:14 +00:00
psych Update dependencies 2016-07-06 05:48:13 +00:00
pty pty.c: dry up 2016-04-30 01:12:52 +00:00
racc/cparse Update dependencies 2016-07-06 05:48:13 +00:00
rbconfig/sizeof rbconfig/sizeof: calculate at compilation time 2016-04-25 05:39:12 +00:00
readline Update dependencies. 2016-04-11 11:50:00 +00:00
ripper probes.dmyh: remove preprocessor directives 2016-07-06 05:03:14 +00:00
sdbm remove unnecessary volatiles 2016-05-23 04:31:55 +00:00
socket socket/option.c: inet_ntop 2016-08-02 03:37:02 +00:00
stringio stringio.c: convert arguments just once 2016-07-11 07:00:58 +00:00
strscan Update dependencies. 2016-04-11 11:50:00 +00:00
syslog Update dependencies. 2016-04-11 11:50:00 +00:00
tk tcltklib.c: remove RUBY_VERSION 2016-08-02 02:18:14 +00:00
win32 resolv.c: fix commit miss 2016-07-31 07:24:45 +00:00
win32ole rb_funcallv 2016-07-29 11:57:14 +00:00
zlib Update dependencies 2016-07-06 05:48:13 +00:00
.document * ext/win32ole/win32ole.c: separate WIN32OLE::VARIANT src file 2014-08-02 14:55:36 +00:00
extmk.rb extmk.rb: build gems 2016-08-01 12:39:54 +00:00
Setup ext/thread: remove 2016-04-30 02:56:17 +00:00
Setup.atheos cgi/escape: Optimize CGI.escapeHTML 2015-12-20 11:54:54 +00:00
Setup.nacl cgi/escape: Optimize CGI.escapeHTML 2015-12-20 11:54:54 +00:00
Setup.nt cgi/escape: Optimize CGI.escapeHTML 2015-12-20 11:54:54 +00:00