mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-06-30 22:21:46 +00:00
Fix #1114
- Ensure short is correctly cast to int, as we're using it as if it were unsigned
This commit is contained in:
parent
a241e594c1
commit
4400b0f83e
|
@ -494,7 +494,7 @@ public final class NBTInputStream implements Closeable {
|
|||
is.readFully(bytes);
|
||||
return (bytes);
|
||||
case NBTConstants.TYPE_STRING:
|
||||
length = is.readShort();
|
||||
length = is.readShort() & 0xFFFF;
|
||||
bytes = new byte[length];
|
||||
is.readFully(bytes);
|
||||
return (new String(bytes, NBTConstants.CHARSET));
|
||||
|
@ -597,7 +597,7 @@ public final class NBTInputStream implements Closeable {
|
|||
is.readFully(bytes);
|
||||
return new ByteArrayTag(bytes);
|
||||
case NBTConstants.TYPE_STRING:
|
||||
length = is.readShort();
|
||||
length = is.readShort() & 0xFFFF;
|
||||
bytes = new byte[length];
|
||||
is.readFully(bytes);
|
||||
return new StringTag(new String(bytes, NBTConstants.CHARSET));
|
||||
|
|
Loading…
Reference in New Issue
Block a user