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