mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 07:25:03 +01:00
fix gacha rewards overflowing
This commit is contained in:
@@ -600,7 +600,8 @@ func handleMsgMhfReceiveGachaItem(s *Session, p mhfpacket.MHFPacket) {
|
||||
data = []byte{0x00}
|
||||
}
|
||||
|
||||
if data[0] > 36 {
|
||||
// I think there are still some edge cases where rewards can be nulled via overflow
|
||||
if data[0] > 36 || len(data) > 181 {
|
||||
resp := byteframe.NewByteFrame()
|
||||
resp.WriteUint8(36)
|
||||
resp.WriteBytes(data[1:181])
|
||||
@@ -610,7 +611,7 @@ func handleMsgMhfReceiveGachaItem(s *Session, p mhfpacket.MHFPacket) {
|
||||
}
|
||||
|
||||
if !pkt.Freeze {
|
||||
if data[0] > 36 {
|
||||
if data[0] > 36 || len(data) > 181 {
|
||||
update := byteframe.NewByteFrame()
|
||||
update.WriteUint8(uint8(len(data[181:]) / 5))
|
||||
update.WriteBytes(data[181:])
|
||||
|
||||
Reference in New Issue
Block a user