Check that nmap.registry.args exists before trying to access

nmap.registry.args["http.useragent"]. The args table doesn't exist
during --script-updatedb. The bug was found by Tom Sellers and fixed by
Jah.
This commit is contained in:
david 2010-01-12 17:53:01 +00:00
parent b12d633b5a
commit f5cae99a2a
2 changed files with 3 additions and 2 deletions

View file

@ -42,7 +42,7 @@ local have_ssl = (nmap.have_ssl() and pcall(require, "openssl"))
local USER_AGENT
do
local arg = nmap.registry.args["http.useragent"]
local arg = nmap.registry.args and nmap.registry.args["http.useragent"]
if arg and arg == "" then
USER_AGENT = nil
elseif arg then