ricochhet/Erupe-Legacy

entrance_server panic when attempting to get world data

sekaiwish opened this issue · 1 comments

Using Arch Linux, relevant output as follows.

2022-03-02T23:20:52.249+1100    INFO    main.sign       signserver/sign_server.go:93    Got connection to sign server   {"remoteaddr": "redacted:51268"}
2022-03-02T23:20:52.339+1100    INFO    main.sign       signserver/session.go:81        Got sign in request     {"reqUsername": "test", "reqPassword": "test", "reqUnk": ""}
2022-03-02T23:20:52.340+1100    INFO    main.sign       signserver/session.go:98        Account not found       {"reqUsername": "test"}
2022-03-02T23:20:52.340+1100    INFO    main.sign       signserver/session.go:102       Creating account        {"reqUsername": "test", "reqPassword": "test"}
2022-03-02T23:21:28.818+1100    DEBUG   main.entrance   entranceserver/entrance_server.go:112   Got entrance server command:
        {"raw": "00000000  41 4c 4c 2b 00                                    |ALL+.|\n"}
panic: runtime error: index out of range [3] with length 0

goroutine 99 [running]:
encoding/binary.littleEndian.Uint32(...)
        /usr/lib/go/src/encoding/binary/binary.go:64
github.com/Andoryuuta/Erupe/server/entranceserver.encodeServerInfo({0xc0001601b0, 0x2, 0x8f0d71})
        /home/wish/erupe2/server/entranceserver/make_resp.go:26 +0x44c
github.com/Andoryuuta/Erupe/server/entranceserver.makeResp({0xc0001601b0, 0x8f0d71, 0x8})
        /home/wish/erupe2/server/entranceserver/make_resp.go:83 +0x38
github.com/Andoryuuta/Erupe/server/entranceserver.(*Server).handleEntranceServerConnection(0xc000380080, {0x9abe60, 0xc0002df6e8})
        /home/wish/erupe2/server/entranceserver/entrance_server.go:114 +0x4a5
created by github.com/Andoryuuta/Erupe/server/entranceserver.(*Server).acceptClients
        /home/wish/erupe2/server/entranceserver/entrance_server.go:88 +0x114
exit status 2

I believe this was caused by providing an invalid host_ip and/or entrance entry ip. Seems to have been mitigated by using a valid address.