diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 07:33:10 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 07:33:10 +0000 |
commit | fba0b81e183be1e477be8e57779512e876cca02f (patch) | |
tree | 5f47b17f75d8ab6ee7f4d6e4a5384a2eed8b8a75 /test/socket | |
parent | 0f4d856d4ddd82638f2ee525ddb8fb4fd5dc1a17 (diff) | |
download | ruby-fba0b81e183be1e477be8e57779512e876cca02f.tar.gz |
test/socket/test_basicsocket.rb (socks): bind explicitly to localhost
Binding to a potentially public IP in a test can cause problems
if hit by a random port scanner or something...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket')
-rw-r--r-- | test/socket/test_basicsocket.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb index 4d11521e9e..0671e97c75 100644 --- a/test/socket/test_basicsocket.rb +++ b/test/socket/test_basicsocket.rb @@ -98,7 +98,7 @@ class TestSocket_BasicSocket < Test::Unit::TestCase end def socks - sserv = TCPServer.new(0) + sserv = TCPServer.new('localhost', 0) ssock = nil t = Thread.new { ssock = sserv.accept } csock = TCPSocket.new('localhost', sserv.addr[1]) |