summaryrefslogtreecommitdiff
path: root/lib/custodian/protocol-tests/tcp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian/protocol-tests/tcp.rb')
-rwxr-xr-xlib/custodian/protocol-tests/tcp.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/custodian/protocol-tests/tcp.rb b/lib/custodian/protocol-tests/tcp.rb
index 08707a5..a6770e4 100755
--- a/lib/custodian/protocol-tests/tcp.rb
+++ b/lib/custodian/protocol-tests/tcp.rb
@@ -92,7 +92,7 @@ class TCPTest
read = socket.gets(nil)
# trim to a sane length & strip newlines.
- read = read[0,255]
+ read = read[0,255] unless ( read.nil? )
read.gsub!(/[\n\r]/, "") unless ( read.nil? )
socket.close()
@@ -102,7 +102,7 @@ class TCPTest
return true
else
# test for banner
- if ( read =~ /#{banner}/i )
+ if ( ( !read.nil? ) && ( read =~ /#{banner}/i ) )
puts "We connected and matched the banner against '#{read}'" if ( @test_data['verbose'] )
return true
end