Mrs4s / go-cqhttp

cqhttp的golang实现,轻量、原生跨平台.
GNU Affero General Public License v3.0
10.4k stars 1.63k forks source link

[Bug]: 频道信息长度为123个bytes时会发生错误 #1312

Closed Zavins closed 2 years ago

Zavins commented 2 years ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

go-cqhttp 版本

v1.0.0-beta8-fix2

运行环境

Windows (64)

运行架构

No response

连接方式

WebSocket (正向)

使用协议

0 | iPad

重现步骤

Python

guild_message = "a" * 125 api.send(guild_id, guild_message...)

期望的结果是什么?

发出消息

实际的结果是什么?

[INFO]: 处置WS命令时发生无法恢复的异常:runtime error: invalid memory address or nil pointer dereference goroutine 243 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x65 github.com/Mrs4s/go-cqhttp/server.(wsConn).handleRequest.func1() github.com/Mrs4s/go-cqhttp/server/websocket.go:449 +0x45 panic({0xadf940, 0x117f050}) runtime/panic.go:1038 +0x215 github.com/Mrs4s/MiraiGo/client.(GuildService).SendGuildChannelMessage(0xc000074e60, 0x6f7e70feaa53f, 0x19458f, 0xc0002ea680) github.com/Mrs4s/MiraiGo@v0.0.0-20211208080234-25c67a3ee1c1/client/guild_msg.go:88 +0x5d3 github.com/Mrs4s/go-cqhttp/coolq.(CQBot).SendGuildChannelMessage(0xc0003701b0, 0x1, 0x7d, 0xc0002ea680) github.com/Mrs4s/go-cqhttp/coolq/bot.go:388 +0x11e github.com/Mrs4s/go-cqhttp/coolq.(CQBot).CQSendGuildChannelMessage(0xc0003701b0, 0x6f7e70feaa53f, 0x0, {0x3, {0xc0004bf074, 0x7d}, {0xc0004bf075, 0x7b}, 0x0, 0x74, ...}, ...) github.com/Mrs4s/go-cqhttp/coolq/api.go:707 +0x2d8 github.com/Mrs4s/go-cqhttp/modules/api.(Caller).call(0xc00010e680, {0xc0004bf00c, 0x16}, {0xcaef40, 0xc00008a9b0}) github.com/Mrs4s/go-cqhttp/modules/api/api.go:200 +0x7e4d github.com/Mrs4s/go-cqhttp/modules/api.(Caller).Call(0xc00010e680, {0xc0004bf00c, 0x16}, {0xcaef40, 0xc00008a9b0}) github.com/Mrs4s/go-cqhttp/modules/api/caller.go:34 +0xaa github.com/Mrs4s/go-cqhttp/server.(wsConn).handleRequest(0xc000382180, 0x0, {0xc0004bf000, 0x10, 0x10}) github.com/Mrs4s/go-cqhttp/server/websocket.go:456 +0x525 github.com/Mrs4s/go-cqhttp/server.(webSocketServer).listenAPI.func2(0xc000065530) github.com/Mrs4s/go-cqhttp/server/websocket.go:438 +0x95 created by github.com/Mrs4s/go-cqhttp/server.(*webSocketServer).listenAPI github.com/Mrs4s/go-cqhttp/server/websocket.go:436 +0x16f

简单的复现代码/链接(可选)

No response

日志记录(可选)

No response

补充说明(可选)

No response

wdvxdr1123 commented 2 years ago

请尝试使用最新版本!