diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-11 06:16:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-11 06:16:04 +0000 |
commit | fb89004a3bb6806b3b571a0592837c0d105e3e61 (patch) | |
tree | 3929464079f7d8c1c032ec96e070c1baf7411ac0 /test | |
parent | 0c551b7a6de46e54e4c273c4b7959aae362d5aa2 (diff) | |
download | ruby-fb89004a3bb6806b3b571a0592837c0d105e3e61.tar.gz |
socket.c: null byte at Socket.getnameinfo
* ext/socket/socket.c (sock_s_getnameinfo): check null byte.
patched by tommy (Masahiro Tomita) in [ruby-dev:50286].
[Bug #13994]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/socket/test_socket.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index 7e75837e8f..5ee09f8e9d 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -105,6 +105,8 @@ class TestSocket < Test::Unit::TestCase def test_getnameinfo assert_raise(SocketError) { Socket.getnameinfo(["AF_UNIX", 80, "0.0.0.0"]) } + assert_raise(ArgumentError) {Socket.getnameinfo(["AF_INET", "http\0", "example.net"])} + assert_raise(ArgumentError) {Socket.getnameinfo(["AF_INET", "http", "example.net\0"])} end def test_ip_address_list |