summaryrefslogtreecommitdiff
path: root/test/resolv/test_addr.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-21 03:37:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-21 03:37:26 +0000
commit1ffbe07e179a2e047d24c7091f6ff013195b1a93 (patch)
tree15566bd714419aee307f263744c9a9d8209ed00b /test/resolv/test_addr.rb
parent96225160f6bffb31dea5ab3c75746d415458d4b6 (diff)
resolv.rb: no encodings
* lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not consider encodings in hosts file. [ruby-core:59239] [Bug #9273] * lib/resolv.rb (Resolv::Config.parse_resolv_conf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/resolv/test_addr.rb')
-rw-r--r--test/resolv/test_addr.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/resolv/test_addr.rb b/test/resolv/test_addr.rb
index 84bc8c2d3b..d4728e1b71 100644
--- a/test/resolv/test_addr.rb
+++ b/test/resolv/test_addr.rb
@@ -13,4 +13,16 @@ class TestResolvAddr < Test::Unit::TestCase
end
}
end
+
+ def test_invalid_byte_comment
+ bug9273 = '[ruby-core:59239] [Bug #9273]'
+ Tempfile.open('resolv_test_addr_') do |tmpfile|
+ tmpfile.print("\xff\x00\x40")
+ tmpfile.close
+ hosts = Resolv::Hosts.new(tmpfile.path)
+ assert_nothing_raised(ArgumentError, bug9273) do
+ hosts.each_address("") {break}
+ end
+ end
+ end
end