1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

ssh2: fix positive mpint packing. Closes #2338

This commit is contained in:
dmiller
2023-01-02 21:20:09 +00:00
parent d8cf5e6eac
commit d4b46b5b43
2 changed files with 4 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ transport.pack_mpint = function( bn )
local bytes, packed
bytes = bn:num_bytes()
packed = bn:tobin()
if bytes % 8 == 0 then
if bn:num_bits() % 8 == 0 then
bytes = bytes + 1
packed = '\0' .. packed
end