mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-27 13:14:41 -04:00
fix buffer length checking bug in readSlot()
This commit is contained in:
parent
bb1918da98
commit
353f156d1a
@ -1088,6 +1088,7 @@ function readSlot(buffer, offset) {
|
||||
var nbtDataSize = buffer.readInt16BE(cursor + 3);
|
||||
if (nbtDataSize === -1) nbtDataSize = 0;
|
||||
var nbtDataEnd = cursorEnd + nbtDataSize;
|
||||
if (nbtDataEnd > buffer.length) return null;
|
||||
var nbtData = buffer.slice(cursorEnd, nbtDataEnd);
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user