mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
Avoid a crash when the IP contains a colon but no hextets
This commit is contained in:
parent
4f7c92fbac
commit
d2d591ce0c
1 changed files with 3 additions and 0 deletions
|
|
@ -381,6 +381,9 @@ expand_ip = function( ip, family )
|
|||
for hdt in string.gmatch( ip, "[%.z%x]+" ) do
|
||||
hexadectets[#hexadectets+1] = hdt
|
||||
end
|
||||
if #hexadectets == 0 then
|
||||
return nil, ( err4:gsub( "IPv4", "IPv6" ) )
|
||||
end
|
||||
|
||||
-- deal with IPv4in6 (last hexadectet only)
|
||||
local t = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue