mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 20:51:30 +00:00
Handle too-short response in s7-info. See #2117
This commit is contained in:
@@ -128,6 +128,10 @@ local function second_parse_response(response, output)
|
|||||||
-- change offset to 4, this is where most of valid PLCs will fall
|
-- change offset to 4, this is where most of valid PLCs will fall
|
||||||
offset = 4
|
offset = 4
|
||||||
end
|
end
|
||||||
|
if #response < 142 + offset then
|
||||||
|
stdnse.debug1("Short response cannot be parsed.")
|
||||||
|
return nil
|
||||||
|
end
|
||||||
-- parse system name
|
-- parse system name
|
||||||
output["System Name"] = string.unpack("z", response, 40 + offset)
|
output["System Name"] = string.unpack("z", response, 40 + offset)
|
||||||
-- parse module type
|
-- parse module type
|
||||||
|
|||||||
Reference in New Issue
Block a user