Skip to content

Commit ba9f879

Browse files
Land rapid7#18369, Fix opt address local crash when ipaddr is nil
2 parents 85cf00e + 871e1f4 commit ba9f879

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/msf/core/opt_address_local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def normalize(value)
2323
addrs = addrs.map { |x| x['addr'].split('%').first }.select do |addr|
2424
begin
2525
IPAddr.new(addr)
26-
rescue IPAddr::InvalidAddressError
26+
rescue IPAddr::Error
2727
false
2828
end
2929
end

spec/lib/msf/core/opt_address_local_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
# Darwin AF_LINK
6363
18 => [
6464
{
65-
'addr' => '55:44:33:22:11:00',
65+
'addr' => '',
6666
'netmask' => nil,
6767
'broadcast' => nil
6868
}

0 commit comments

Comments
 (0)