mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-07-16 00:37:10 -05:00
Merge pull request #25 from MikeIsAStar/do-not-forward-malicious-messages-to-clients
QR2: Do not forward malicious messages to clients
This commit is contained in:
commit
e86d751428
|
|
@ -76,7 +76,13 @@ func SendClientMessage(senderIP string, destSearchID uint64, message []byte) {
|
|||
senderProfileID := binary.LittleEndian.Uint32(message[0x10:0x14])
|
||||
moduleName = "QR2/MSG:p" + strconv.FormatUint(uint64(senderProfileID), 10)
|
||||
|
||||
if (int(message[9]) + 0x14) != len(message) {
|
||||
dataSize := message[9]
|
||||
if dataSize > 0x80 {
|
||||
logging.Error(moduleName, "Received malicious match command packet header")
|
||||
return
|
||||
}
|
||||
|
||||
if (int(dataSize) + 0x14) != len(message) {
|
||||
logging.Error(moduleName, "Received invalid match command packet header")
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user