Team-Silver-Sphere / SquadJS

Squad Server Script Framework
Boost Software License 1.0
166 stars 124 forks source link

RCON ERR_BUFFER_OUT_OF_BOUNDS #45

Closed Thomas-Smyth closed 3 years ago

Thomas-Smyth commented 4 years ago

Description of Issue

ListPlayer is causing RCON to crash.

The example below was taken from a Russian server so it is quite likely that some different characters are being used that are not being used on the EU/US servers SquadJS is primarily used on. That means it's likely an encoding issue. We should try some of these player names in the info below to see if we can replicate the crash.

Errors or Screenshots of Issue

[1598371049314] RCON (Verbose): Method Exec: execute(ShowNextMap)
[1598371062832] RCON (Verbose): Method Exec: execute(ListPlayers)
internal/buffer.js:79
    throw new ERR_BUFFER_OUT_OF_BOUNDS();
    ^

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
    at boundsError (internal/buffer.js:79:11)
    at Buffer.readInt32LE (internal/buffer.js:385:5)
    at Rcon.decodePacket (file:///home/kry/SquadJS/squad-server/rcon/index.js:301:17)
    at Rcon.onData (file:///home/kry/SquadJS/squad-server/rcon/index.js:251:34)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:303:12)
    at readableAddChunk (_stream_readable.js:279:9)
    at Socket.Readable.push (_stream_readable.js:218:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
  code: 'ERR_BUFFER_OUT_OF_BOUNDS'

The following is a list Battlemetrics provided of players at the time of the crash:

MORFEY | 02:54 |  
[MSR] L.I.N.K | 02:35 |  
Boon | 02:09 |  
paatrik3 )) | 02:09 |  
BLACK | 01:53 |  
Shadow | 01:53 |  
Boroda | 01:45 |  
dddfffggg123666 | 01:38 |  
molva7 | 01:38 |  
Σταυρός❤Ставрос | 01:38 |  
Beaver | 01:32 |  
Рокко | 01:26 |  
Adeptus Fresco | 01:21 |  
dzrLee | 01:21 |  
Полумягкие овощи | 01:17 |  
_Zevs_ | 01:12 |  
Axeron | 01:12 |  
Hans | 01:12 |  
Ramzes | 01:12 |  
... | 01:04 |  
Flex | 01:04 |  
Бронко | 01:04 |  
[ DS ] DRAKNET | 01:01 |  
Vasya | 01:01 |  
Feels_Mylls | 00:58 |  
Sparky | 00:52 |  
Tayrek | 00:52 |  
thirst | 00:52 |  
Asteks | 00:50 |  
frozya | 00:50 |  
Gorynych | 00:50 |  
MOXITO | 00:47 |  
Asap Rokievna | 00:45 |  
666 | 00:43 |  
Leonardo | 00:43 |  
Player | 00:41 |  
Любимчик Хо Ши Ми | 00:41 |  
Strong Slave System | 00:41 |  
Senodya кабачок | 00:39 |  
UNIT28 | 00:39 |  
✔ Оригинал ™®®®® | 00:37 |  
B.iG | 00:37 |  
Cpt. Doebailo | 00:33 |  
DeX | 00:33 |  
morkovka | 00:33 |  
Дядя Миша | 00:30 |  
ozeleninator | 00:28 |  
GHOST black | 00:26 |  
CEP}\|{AHT_ZAPASA | 00:25 |  
denismeister=DD | 00:25 |  
eazy-e | 00:25 |  
eZstah | 00:25 |  
TIMBORODA | 00:24 |  
1Nagan | 00:22 |  
DarK_Knight[RUS] | 00:22 |  
Kesha | 00:22 |  
Anchor! | 00:21 |  
Sv!FTy | 00:21 |  
Lamerito | 00:20 |  
Nil | 00:20 |  
Шампунь | 00:20 |  
Mauro G | 00:19 |  
Mindhunter | 00:19 |  
Mozg | 00:19 |  
NickAir | 00:18 |  
Sardsvipe | 00:18 |  
⚜HOPELESS⚜ | 00:15 |  
bitchr | 00:12 |  
delfin97 | 00:12 |  
Nightery | 00:12 |  
Vladigor | 00:12 |  
Almaz | 00:11 |  
T1p | 00:06 |  
RichiE | 00:03 |  
KyJluHaP | 00:01 |  
Marty | 00:01 |  
H0rdi. | 00:00 |  
kry | 00:00

In a separate crash it looks to have been one of these names:

усыновлённая доч | 00:07 |  
SkyGuard | 00:04 |  
КТО МЯУКАЕТ | 00:05 |

Another: ~ 2020.08.25-18.54.42:119

[1598381662749] RCON (Verbose): Method Exec: execute(ListPlayers)
internal/buffer.js:79
    throw new ERR_BUFFER_OUT_OF_BOUNDS();
    ^

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
    at boundsError (internal/buffer.js:79:11)
    at Buffer.readInt32LE (internal/buffer.js:385:5)
    at Rcon.decodePacket (file:///home/kry/SquadJS/squad-server/rcon/index.js:301:17)
    at Rcon.onData (file:///home/kry/SquadJS/squad-server/rcon/index.js:251:34)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:303:12)
    at readableAddChunk (_stream_readable.js:279:9)
    at Socket.Readable.push (_stream_readable.js:218:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
  code: '
[2020.08.25-18.31.02:107][391]LogNet: Join succeeded: Dezmont
[2020.08.25-18.32.23:689][282]LogNet: Join succeeded: skR1me
[2020.08.25-18.35.06:964][979]LogNet: Join succeeded: Михаил Круг
[2020.08.25-18.41.12:015][120]LogNet: Join succeeded: minyor
[2020.08.25-18.42.19:366][342]LogNet: Join succeeded: Paranoid
[2020.08.25-18.45.41:575][897]LogNet: Join succeeded: Podkradun
[2020.08.25-18.46.07:422][115]LogNet: Join succeeded: the_TAB
[2020.08.25-18.49.15:749][920]LogNet: Join succeeded: Macentosh05
[2020.08.25-18.53.10:272][552]LogNet: Join succeeded: КОПЧЕННЫЙ
[2020.08.25-18.53.51:691][404]LogNet: Join succeeded: andreev.4lex
[2020.08.25-18.53.58:750][716]LogNet: Join succeeded: TimDas
[2020.08.25-18.55.27:895][778]LogNet: Join succeeded: чаэсве
[2020.08.25-18.55.51:604][893]LogNet: Join succeeded: Thanator

Squad Information

System Information

Thomas-Smyth commented 3 years ago

The RCON client has been rewritten for SquadJS v2 so I will close this on the basis the issue is most likely no longer present or this existing research will not be relevant to any new issue.