QR2: Do not forward malicious messages to clients

This commit is contained in:
MikeIsAStar
2023-12-13 16:15:00 -05:00
parent 821ae1e537
commit 842d8d9921

View File

@@ -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
}