mirror of
https://github.com/nmap/nmap.git
synced 2026-01-05 22:19:03 +00:00
Fixes IP validation pattern (reported by Galen Lyngholm)
This commit is contained in:
@@ -95,7 +95,7 @@ end
|
||||
|
||||
|
||||
local function validateIP(matched_ip)
|
||||
local oct_1, oct_2, oct_3, oct_4 = matched_ip:match('(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d)%.(%d%d?%d?)')
|
||||
local oct_1, oct_2, oct_3, oct_4 = matched_ip:match('^(%d+)%.(%d+)%.(%d+)%.(%d+)$')
|
||||
if tonumber(oct_1) > 255 or tonumber(oct_2) > 255 or tonumber(oct_3) > 255 or tonumber(oct_4) > 255 then
|
||||
return false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user