mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix sso frame panic
This commit is contained in:
parent
afb81a32aa
commit
21f8feb419
@ -139,13 +139,13 @@ func parseSsoFrame(payload []byte, flag2 byte) (*IncomingPacket, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
compressedFlag := head.ReadInt32()
|
compressedFlag := head.ReadInt32()
|
||||||
bodyLen := reader.ReadInt32()
|
reader.ReadInt32()
|
||||||
packet := func() []byte {
|
packet := func() []byte {
|
||||||
if compressedFlag == 0 {
|
if compressedFlag == 0 {
|
||||||
return reader.ReadBytes(int(bodyLen) - 4)
|
return reader.ReadAvailable()
|
||||||
}
|
}
|
||||||
if compressedFlag == 1 {
|
if compressedFlag == 1 {
|
||||||
return binary.ZlibUncompress(reader.ReadBytes(int(bodyLen) - 4))
|
return binary.ZlibUncompress(reader.ReadAvailable())
|
||||||
}
|
}
|
||||||
if compressedFlag == 8 {
|
if compressedFlag == 8 {
|
||||||
return reader.ReadAvailable()
|
return reader.ReadAvailable()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user