aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:33:10 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:33:10 +0000
commit927e8d4f3d700b4f441fd6ea9327be93d32e32fa (patch)
tree5f47b17f75d8ab6ee7f4d6e4a5384a2eed8b8a75 /test
parentabc31b4ba0539e90ded72557212efc1fb23736c8 (diff)
downloadruby-927e8d4f3d700b4f441fd6ea9327be93d32e32fa.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')
-rw-r--r--test/socket/test_basicsocket.rb2
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])