mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
fix: possible sql inject
This commit is contained in:
parent
fc51a69ff1
commit
bc80944f26
@ -180,10 +180,13 @@ func (s *database) GetPrivateMessageByGlobalID(id int32) (*db.StoredPrivateMessa
|
||||
}
|
||||
|
||||
func (s *database) GetGuildChannelMessageByID(id string) (*db.StoredGuildChannelMessage, error) {
|
||||
_, err := base64.StdEncoding.DecodeString(id)
|
||||
b, err := base64.StdEncoding.DecodeString(id)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "query invalid id error")
|
||||
}
|
||||
if len(b) < 25 {
|
||||
return nil, errors.New("query invalid id error: content too short")
|
||||
}
|
||||
var ret db.StoredGuildChannelMessage
|
||||
var guildmsg StoredGuildChannelMessage
|
||||
s.RLock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user