1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 00:19:01 +00:00

Fix an off-by-one bug in TLS record parsing

This commit is contained in:
dmiller
2014-04-08 20:12:21 +00:00
parent ac863d6b10
commit c87a4f1b3f

View File

@@ -673,6 +673,7 @@ function record_read(buffer, i)
b["extensions"] = {}
j, num_exts = bin.unpack(">S", buffer, j)
for e = 0, num_exts do
if j >= msg_end then break end
local extcode, datalen
j, extcode = bin.unpack(">S", buffer, j)
extcode = find_key(EXTENSIONS, extcode) or extcode
@@ -692,7 +693,7 @@ function record_read(buffer, i)
end
-- Ignore unparsed bytes.
j = len
j = len+1
return j, h
end