1
0
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:
nnposter
2017-02-23 02:55:06 +00:00
parent cc0661fb34
commit cae3e7977a

View File

@@ -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