Skip to content

Commit

Permalink
Missed checks in ClientCacheBlobStatusSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Jul 12, 2024
1 parent aa4b792 commit ce303cd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public void deserialize(ByteBuf buffer, BedrockCodecHelper helper, ClientCacheBl
int maxLength = helper.getEncodingSettings().maxListSize();

int naksLength = VarInts.readUnsignedInt(buffer);
checkArgument(maxLength == 0 || naksLength <= maxLength, "Tried to read %s Nacks but maximum is %s", naksLength, maxLength);
checkArgument(maxLength <= 0 || naksLength <= maxLength, "Tried to read %s Nacks but maximum is %s", naksLength, maxLength);

int acksLength = VarInts.readUnsignedInt(buffer);
checkArgument(maxLength == 0 || acksLength <= maxLength, "Tried to read %s Nacks but maximum is %s", acksLength, maxLength);
checkArgument(maxLength <= 0 || acksLength <= maxLength, "Tried to read %s Nacks but maximum is %s", acksLength, maxLength);

LongList naks = packet.getNaks();
for (int i = 0; i < naksLength; i++) {
Expand Down

0 comments on commit ce303cd

Please sign in to comment.