From e662a8c9d546135c569b5858e93904a00b52f685 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 26 Jun 2018 17:10:15 +0800 Subject: [PATCH] Combine PRs #306 & #308 --- lib/net/ldap/connection.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/net/ldap/connection.rb b/lib/net/ldap/connection.rb index 61aacb53..e2c24e9a 100644 --- a/lib/net/ldap/connection.rb +++ b/lib/net/ldap/connection.rb @@ -74,7 +74,8 @@ def open_connection(server) module GetbyteForSSLSocket def getbyte - getc.ord + (nextbyte = read(1)) or return + nextbyte.ord end end @@ -467,6 +468,10 @@ def search(args = nil) end end + if result_pdu.nil? + raise Net::LDAP::ResponseMissingOrInvalidError, "response missing" + end + # count number of pages of results payload[:page_count] ||= 0 payload[:page_count] += 1