mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Fix a bug in dns.lua: ensure that dns.query() always return two values (status and response).
Update asn-query.nse accordingly.
This commit is contained in:
parent
feb691f534
commit
b7df13296e
2 changed files with 4 additions and 4 deletions
|
|
@ -370,7 +370,7 @@ local answerFetcher = {}
|
|||
answerFetcher[types.TXT] = function(dec, retAll)
|
||||
local answers = {}
|
||||
if not retAll and dec.answers[1].data then
|
||||
return string.sub(dec.answers[1].data, 2)
|
||||
return true, string.sub(dec.answers[1].data, 2)
|
||||
elseif not retAll then
|
||||
stdnse.print_debug(1, "dns.answerFetcher found no records of the required type: TXT")
|
||||
return false, "No Answers"
|
||||
|
|
@ -599,7 +599,7 @@ local additionalFetcher = {}
|
|||
additionalFetcher[types.TXT] = function(dec, retAll)
|
||||
local answers = {}
|
||||
if not retAll and dec.add[1].data then
|
||||
return string.sub(dec.add[1].data, 2)
|
||||
return true, string.sub(dec.add[1].data, 2)
|
||||
elseif not retAll then
|
||||
stdnse.print_debug(1, "dns.aditionalFetcher found no records of the required type: TXT")
|
||||
return false, "No Answers"
|
||||
|
|
|
|||
|
|
@ -287,8 +287,8 @@ function asn_description( asn )
|
|||
|
||||
-- send query
|
||||
local query = ( "AS%s.asn.cymru.com" ):format( asn )
|
||||
local decoded_response, other_response = dns.query( query, options)
|
||||
if type( decoded_response ) ~= "string" then
|
||||
local status, decoded_response = dns.query( query, options )
|
||||
if not status then
|
||||
return ""
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue