fix nil pointer dereference caused by nil 'cs'#2440
Merged
Conversation
修复刷新 token 时若当前签名服务不可用而主签名服务可用会导致panic的问题。 btw, energy 出现decode error时打印出导致错误的数据内容
修复在qsign崩溃重启前请求了签名服务器导致当前签名服务器被标记为不可用(`ss.set(nil)`), 从而不会再执行sign请求(除非有其他请求签名服务器的操作) 这可能导致下一次刷新token提示uin is not registered或者提示未初始化
Contributor
panic: runtime error: slice bounds out of range [:6] with capacity 3
goroutine 1703217 [running]:
github.com/Mrs4s/go-cqhttp/cmd/gocq.signSubmit({0xc0003a4122, 0xa}, {0xc0019a0c2
0, 0x30}, 0xa1?, {0xc0018eed50, 0x3, 0x3}, {0xb07862, 0xd})
E:/project/Go/go-cqhttp/cmd/gocq/login.go:321 +0x6de
github.com/Mrs4s/go-cqhttp/cmd/gocq.signCallback({0xc0003a4122, 0xa}, {0xc001191
540?, 0x1, 0x0?}, {0xb07862, 0xd})
E:/project/Go/go-cqhttp/cmd/gocq/login.go:342 +0xa5
created by github.com/Mrs4s/go-cqhttp/cmd/gocq.signRefreshToken in goroutine 58
E:/project/Go/go-cqhttp/cmd/gocq/login.go:421 +0x7eb罕见情况下会越界,但是触发方式还没去研究(课太多了就不想看了 |
Contributor
Author
|
不会吧,这个应该之前就修过了,理论上应该不会出这个错()。确定是这个pr编译的吗() |
Contributor
犯蠢了,我用的旧版本,忙晕了看来 |
fumiama
approved these changes
Oct 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
invalid memory address or nil pointer dereference#2437