1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-01 12:29:03 +00:00

Fix DNS TXT record parsing

This commit is contained in:
dmiller
2023-06-06 15:10:48 +00:00
parent 4a4253cc95
commit 9adda8c0f3
2 changed files with 6 additions and 4 deletions

View File

@@ -1160,9 +1160,8 @@ decoder[types.PTR] = decDomain
decoder[types.TXT] =
function (entry, data, pos)
local len = entry.data:len()
local np = pos - #entry.data
local txt_len
local len = #entry.data
local np = pos - len
local txt
if len > 0 then
@@ -1170,7 +1169,7 @@ function (entry, data, pos)
entry.TXT.text = {}
end
while np < len do
while np < pos do
txt, np = string.unpack("s1", data, np)
table.insert( entry.TXT.text, txt )
end