mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +00:00
Use explicit endianness in pack/unpack.
This commit is contained in:
@@ -131,7 +131,7 @@ function toBson(dict)
|
||||
end
|
||||
dbg("Packet length is %d",length)
|
||||
--Final pack
|
||||
return true, bin.pack("I", length) .. elements .. "\0"
|
||||
return true, bin.pack("<I", length) .. elements .. "\0"
|
||||
end
|
||||
|
||||
-- Reads a null-terminated string. If length is supplied, it is just cut
|
||||
@@ -376,7 +376,7 @@ MongoData ={
|
||||
--Adds unsigned int32 to the message body
|
||||
--@param value the value to add
|
||||
function MongoData:addUnsignedInt32(value)
|
||||
self.valueString = self.valueString..bin.pack("I",value)
|
||||
self.valueString = self.valueString..bin.pack("<I",value)
|
||||
end
|
||||
-- Adds a string to the message body
|
||||
--@param value the string to add
|
||||
|
||||
Reference in New Issue
Block a user