zhaojh329 / rttys

Access your device's terminal from anywhere via the web.
MIT License
668 stars 194 forks source link

rttys panic: runtime error: slice bounds out of range [:4] with capacity 0 #137

Open legale opened 1 year ago

legale commented 1 year ago

Environment

rtty

Description

rttys crash on client connected. Without any client connection rttys works well.

root@wnam-14:~# rttys run
2023-05-07T22:43:12+03:00 |INFO| Go Version: go1.18.1
2023-05-07T22:43:12+03:00 |INFO| Go OS/Arch: linux/amd64
2023-05-07T22:43:12+03:00 |INFO| Rttys Version: 4.1.0
2023-05-07T22:43:12+03:00 |INFO| Git Commit: d55eac3
2023-05-07T22:43:12+03:00 |INFO| Build Time: 2022-09-25T13:45:39+0000
2023-05-07T22:43:12+03:00 |INFO| Listen device on: :5912 SSL off
2023-05-07T22:43:12+03:00 |INFO| Automatically select an available port for http proxy
2023-05-07T22:43:12+03:00 |INFO| Listen http proxy on: [::]:35849
2023-05-07T22:43:12+03:00 |INFO| Listen user on: :5913 SSL off
2023-05-07T22:43:13+03:00 |DEBU| Device '172.16.137.45:49304' connected
2023-05-07T22:43:13+03:00 |INFO| Device '00000' registered, proto 52
2023-05-07T22:43:14+03:00 |DEBU| Device '172.16.137.45:49304' disconnected
panic: runtime error: slice bounds out of range [:4] with capacity 0

goroutine 13 [running]:
main.parseHeartbeat(...)
 /home/runner/work/rttys/rttys/device.go:189
main.(*device).readLoop(0xc000122ab0)
 /home/runner/work/rttys/rttys/device.go:293 +0xdbe
created by main.listenDevice.func1
 /home/runner/work/rttys/rttys/device.go:412 +0x334
root@wnam-14:~#