fix buffer length checking bug in readSlot()

This commit is contained in:
Xabier de Zuazo 2013-04-06 19:34:10 +02:00
parent bb1918da98
commit 353f156d1a

View File

@ -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 {