1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-02-16 00:24:29 +01:00

Fix issue with packet size calculation

This commit fixes an issue where the transports were calculating an
incorrect size for the packet that was being received. This wasn't
noticable until packet pivot work started, and for some reason wasn't
causing breakages during local testing. Either way, it's fixed now!
This commit is contained in:
OJ 2017-07-17 11:11:25 +10:00
parent 9bb22ad251
commit fac1bfa489
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
2 changed files with 2 additions and 2 deletions

View File

@ -459,7 +459,7 @@ static DWORD packet_receive(Remote *remote, Packet **packet)
payloadLength = ntohl(header.length) - sizeof(TlvHeader);
vdprintf("[TCP] Payload length is %d", payloadLength);
DWORD packetSize = sizeof(PacketHeader) + payloadLength + sizeof(TlvHeader);
DWORD packetSize = sizeof(PacketHeader) + payloadLength;
vdprintf("[TCP] total buffer size for the packet is %d", packetSize);
payloadBytesLeft = payloadLength;

View File

@ -499,7 +499,7 @@ static DWORD packet_receive_http(Remote *remote, Packet **packet)
payloadLength = ntohl(header.length) - sizeof(TlvHeader);
vdprintf("[REC HTTP] Payload length is %d", payloadLength);
DWORD packetSize = sizeof(PacketHeader) + payloadLength + sizeof(TlvHeader);
DWORD packetSize = sizeof(PacketHeader) + payloadLength;
vdprintf("[REC HTTP] total buffer size for the packet is %d", packetSize);
payloadBytesLeft = payloadLength;