RCON ERR_BUFFER_OUT_OF_BOUNDS fix

This commit is contained in:
Thomas Smyth 2020-11-07 00:07:51 +00:00
parent fa8df8a0f1
commit 98c4278038

View File

@ -114,7 +114,9 @@ export default class Rcon extends EventEmitter {
const packets = [];
while (this.incomingData.byteLength > 0) {
// we check that it's greater than 4 as if it's not then the length header is not fully present which breaks the
// rest of the code. We just need to wait for more data.
while (this.incomingData.byteLength >= 4) {
const size = this.incomingData.readInt32LE(0);
const packetSize = size + 4;