mirror of
https://github.com/nmap/nmap.git
synced 2026-06-24 10:12:22 +00:00
Fix a problem which prevented proper port number matching in port_or_service() because the port variable passed to portnumber is shadowed by the variable passed during portrule check. Report and patch are from Sven Klemm
This commit is contained in:
parent
7a7f415586
commit
165e79a95d
1 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ service = function(service, _proto, _state)
|
|||
end
|
||||
end
|
||||
|
||||
port_or_service = function(port, _service, proto, _state)
|
||||
port_or_service = function(_port, _service, proto, _state)
|
||||
local state = _state or {"open", "open|filtered"}
|
||||
local state_table
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ port_or_service = function(port, _service, proto, _state)
|
|||
|
||||
return function(host, port)
|
||||
for _, state in pairs(state_table) do
|
||||
local port_checker = portnumber(port, proto, state)
|
||||
local port_checker = portnumber(_port, proto, state)
|
||||
local service_checker = service(_service, proto, state)
|
||||
if (port_checker(host, port) or service_checker(host, port)) then
|
||||
return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue