Skip to content

Commit

Permalink
Check for lower than 0 in EntityData limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Jul 12, 2024
1 parent c746a24 commit aa4b792
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public void readEntityData(ByteBuf buffer, EntityDataMap entityDataMap) {
checkNotNull(entityDataMap, "entityDataDictionary");

int length = VarInts.readUnsignedInt(buffer);
checkArgument(this.encodingSettings.maxListSize() == 0 || length <= this.encodingSettings.maxListSize(), "Entity data size is too big: %s", length);
checkArgument(this.encodingSettings.maxListSize() <= 0 || length <= this.encodingSettings.maxListSize(), "Entity data size is too big: %s", length);

for (int i = 0; i < length; i++) {
int id = VarInts.readUnsignedInt(buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void readEntityData(ByteBuf buffer, EntityDataMap entityDataMap) {
checkNotNull(entityDataMap, "entityDataDictionary");

int length = VarInts.readUnsignedInt(buffer);
checkArgument(this.encodingSettings.maxListSize() == 0 || length <= this.encodingSettings.maxListSize(), "Entity data size is too big: %s", length);
checkArgument(this.encodingSettings.maxListSize() <= 0 || length <= this.encodingSettings.maxListSize(), "Entity data size is too big: %s", length);

for (int i = 0; i < length; i++) {
int id = VarInts.readUnsignedInt(buffer);
Expand Down

0 comments on commit aa4b792

Please sign in to comment.