Skip to content

Commit

Permalink
possible not enough data bug in PWP
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzehdee committed Oct 20, 2023
1 parent 42064bf commit 35f71c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bzTorrent/Data/PeerWirePacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public class PeerWirePacket

public bool Parse(byte[] currentPacketBuffer)
{
if(currentPacketBuffer.Length < 4)
{
return false;
}

var commandLength = UnpackHelper.UInt32(currentPacketBuffer, 0, UnpackHelper.Endianness.Big);
CommandLength = commandLength;

Expand Down

0 comments on commit 35f71c7

Please sign in to comment.