1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-14 09:26:35 +00:00

Fixes crash when attempting to sort services that have no port.

This commit is contained in:
patrik
2010-06-15 18:18:09 +00:00
parent 7c658dd3fd
commit b6744a3b6c

View File

@@ -95,8 +95,8 @@ end
-- @param b table containing second item
-- @return true if the port of a is less than the port of b
local function serviceCompare(a, b)
local port_a = a.name:match("^(%d+)")
local port_b = b.name:match("^(%d+)")
local port_a = a.name:match("^(%d+)") or 0
local port_b = b.name:match("^(%d+)") or 0
if ( tonumber(port_a) < tonumber(port_b) ) then
return true