diff options
author | normal <normal@ruby-lang.org> | 2015-08-01 22:08:17 +0000 |
---|---|---|
committer | normal <normal@ruby-lang.org> | 2015-08-01 22:08:17 +0000 |
commit | f5652e7c4bc1016567772833922aa7be16537f38 (patch) | |
tree | b6bf6c111e96f686f8ebdbfbb6c820660041ac50 /lib/openssl | |
parent | 21279aa4669da51ff86036ed8858cf0d27142ceb (diff) | |
download | ruby-openssl-history-f5652e7c4bc1016567772833922aa7be16537f38.tar.gz |
openssl/buffering: fix gets on EOF with limit
* ext/openssl/lib/openssl/buffering.rb (gets):
avoid comparing fixnum with nil
* test/openssl/test_pair.rb: test gets with limit when EOF is hit
Thanks to Bar Hofesh <bar.hofesh@safe-t.com> for the bug report
and testing.
[ruby-core:70149] [Bug #11400]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/openssl')
-rw-r--r-- | lib/openssl/buffering.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb index 099e960..63444cc 100644 --- a/lib/openssl/buffering.rb +++ b/lib/openssl/buffering.rb @@ -213,7 +213,7 @@ module OpenSSL::Buffering else size = idx ? idx+eol.size : nil end - if limit and limit >= 0 + if size && limit && limit >= 0 size = [size, limit].min end consume_rbuff(size) |