From 8ae3ee2c7c5588504e02a35aab007e370b497df4 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 6 Aug 2018 21:23:07 +0000 Subject: [PATCH] Avoid crash if only testing port for likely SSL, not host. Fixes #1286 --- nselib/shortport.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nselib/shortport.lua b/nselib/shortport.lua index df2583889..79f439857 100644 --- a/nselib/shortport.lua +++ b/nselib/shortport.lua @@ -234,6 +234,8 @@ function ssl(host, port) port_or_service(LIKELY_SSL_PORTS, LIKELY_SSL_SERVICES, {"tcp", "sctp"})(host, port) then return true end + -- If we're just looking up port info, stop here. + if not host then return false end -- if we didn't detect something *not* SSL, check it ourselves if port.version and port.version.name_confidence <= 3 and host.registry then comm = comm or require "comm"