From 5be0ac591bf350f4c2d6d6d8b271ab62beed26e3 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 23 May 2016 04:30:05 +0000 Subject: [PATCH] Avoid a crash when host has no domain configured --- scripts/broadcast-wpad-discover.nse | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/broadcast-wpad-discover.nse b/scripts/broadcast-wpad-discover.nse index 6f049989a..8d781204c 100644 --- a/scripts/broadcast-wpad-discover.nse +++ b/scripts/broadcast-wpad-discover.nse @@ -151,7 +151,10 @@ local function dnsDiscover() -- first get all unique domain names if ( not(name:match("in%-addr.arpa$")) ) then local domain = name:match("^[^%.]-%.(.*)$") - domains[domain] = true + -- Check that the name has a domain component + if domain then + domains[domain] = true + end end end