From e6b5e940fdb8e2ded70a80132af6c280db02e8d8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Mar 2011 08:30:40 +0000 Subject: inet_diag: stricter IPv6 address parsing Be stricter about invalid inputs. --- test/test_linux_ipv6.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_linux_ipv6.rb b/test/test_linux_ipv6.rb index bd24cab..479b9a2 100644 --- a/test/test_linux_ipv6.rb +++ b/test/test_linux_ipv6.rb @@ -96,6 +96,11 @@ class TestLinuxIPv6 < Test::Unit::TestCase assert_equal 1, stats[addr2].active end + def test_invalid_addresses + assert_raises(ArgumentError) { tcp_listener_stats(%w([1:::5)) } + assert_raises(ArgumentError) { tcp_listener_stats(%w([1:::]5)) } + end + # tries to overflow buffers def test_tcp_stress_test nr_proc = 32 -- cgit v1.2.3-24-ge0c7