mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Handle the case of half-byte hex string in ipOps.hex_to_bin
This commit is contained in:
parent
08709b41dc
commit
b1c8c3f224
1 changed files with 2 additions and 2 deletions
|
|
@ -9,7 +9,6 @@ local stdnse = require "stdnse"
|
|||
local string = require "string"
|
||||
local table = require "table"
|
||||
local type = type
|
||||
local select = select
|
||||
local ipairs = ipairs
|
||||
local tonumber = tonumber
|
||||
local unittest = require "unittest"
|
||||
|
|
@ -648,7 +647,8 @@ hex_to_bin = function( hex )
|
|||
end
|
||||
|
||||
local d = bin.pack("H", hex)
|
||||
return select(2, bin.unpack("B" .. #d, d))
|
||||
local _, b = bin.unpack("B" .. #d, d)
|
||||
return b:sub(1, #hex * 4)
|
||||
end
|
||||
|
||||
--Ignore the rest if we are not testing.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue