Skip to content

Commit

Permalink
Fix message retaining residual data
Browse files Browse the repository at this point in the history
This caused issues when extra data was added to a message upon being received
  • Loading branch information
xzippyzachx committed Jan 9, 2024
1 parent 8bbaa3e commit 54ac329
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions RiptideNetworking/RiptideNetworking/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ private Message Init(MessageHeader header)
/// <returns>The message, ready to be used for handling.</returns>
internal Message Init(byte firstByte, int contentLength, out MessageHeader header)
{
data[contentLength / sizeof(ulong)] = 0;
data[0] = firstByte;
header = (MessageHeader)(firstByte & HeaderBitmask);
SetHeader(header);
Expand Down

0 comments on commit 54ac329

Please sign in to comment.