1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Check for valid nSender field on RedNet message receive (#1200)

This commit is contained in:
Alessandro Proto 2022-11-03 09:40:37 +01:00 committed by GitHub
parent 0f1f5247ca
commit c919011a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -463,6 +463,7 @@ function run()
if channel == id_as_channel() or channel == CHANNEL_BROADCAST then
if type(message) == "table" and type(message.nMessageID) == "number"
and message.nMessageID == message.nMessageID and not received_messages[message.nMessageID]
and (type(message.nSender) == "nil" or (type(message.nSender) == "number" and message.nSender == message.nSender))
and ((message.nRecipient and message.nRecipient == os.getComputerID()) or channel == CHANNEL_BROADCAST)
and isOpen(modem)
then