1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Clarify upper boundary for variable-length numerical fields

This commit is contained in:
nnposter
2020-07-17 20:56:39 +00:00
parent 9635eabb9f
commit 3421d01d2e

View File

@@ -797,9 +797,9 @@ end
-- @param num The value of the field.
-- @return A variable-length field.
MQTT.length_build = function(num)
-- This field represents a limited range of integers.
-- This field represents a limited range of integers (0 through 128^4-1)
assert(num >= 0)
assert(num <= 268435455)
assert(num < 0x10000000)
local field = {}
repeat
@@ -854,9 +854,9 @@ MQTT.length_parse = function(buf, pos)
offset = offset + 1
until (byte & 0x80) == 0
-- This field represents a limited range of integers.
-- This field represents a limited range of integers (0 through 128^4-1)
assert(num >= 0)
assert(num <= 268435455)
assert(num < 0x10000000)
return pos, num
end