Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #387 from mozilla/add_exception_handling_targets
Browse files Browse the repository at this point in the history
Fix exception feedback
  • Loading branch information
Jonathan Claudius authored Jun 14, 2017
2 parents 08c6579 + 830454d commit ef3e0d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ssh_scan/target_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def enumerateIPRange(ip,port)
end
return ip_array
elsif ip.include? "/"
cidr = NetAddr::CIDR.create(ip)
begin
cidr = NetAddr::CIDR.create(ip)
rescue
raise ArgumentError, "Invalid target: #{ip}"
end
ip_array = cidr.enumerate
ip_array.delete(cidr.network)
ip_array.delete(cidr.last)
Expand Down

0 comments on commit ef3e0d0

Please sign in to comment.