Skip to content

panic: runtime error: makeslice: len out of range in rcon.Dial #5

@cezarmathe

Description

@cezarmathe

My usage: https://github.com/cezarmathe/stevebot/blob/ac309b0f0555ec6f87572caf5f42b92180926789/cmd/stevebot2/main.go#L72

My logs:

1.6525867005549443e+09	info	stevebot2/main.go:55	hello, this is stevebot2
1.6525867005552022e+09	debug	stevebot2/main.go:64	main config	{"value": {"DiscordToken":"redacted","RconAddress":"redacted:25565","RconPassword":"redacted","Bot":{"CommandPrefix":"~"},"Steve":{"AllowedCommands":["help","seed","whitelist"]}}}
panic: runtime error: makeslice: len out of range

goroutine 1 [running]:
github.com/gorcon/rcon.(*Conn).auth(0xc00001e280, {0xc00002604e?, 0xc00002a04d?})
	/path/to/my/go/root/pkg/mod/github.com/gorcon/rcon@v1.3.1/rcon.go:202 +0x227
github.com/gorcon/rcon.Dial({0xc00002a04d, 0x13}, {0xc00002604e, 0x28}, {0x0, 0x0, 0x1?})
	/path/to/my/go/root/pkg/mod/github.com/gorcon/rcon@v1.3.1/rcon.go:112 +0x196
main.main()
	/path/to/project/root/stevebot/cmd/stevebot2/main.go:72 +0x668

I've identified that this issue comes from

rcon/rcon.go

Line 202 in 79dc2ba

buffer := make([]byte, response.Size-PacketHeaderSize)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions