mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Fixes crash when attempting to sort services that have no port.
This commit is contained in:
parent
7c658dd3fd
commit
b6744a3b6c
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue