1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +00:00

Fix a crash in rednet repeat

This crash can be triggered remotely by specially constructed rednet messages, making this a bit of a problem, as any repeaters can be remotely crashed.
This commit is contained in:
Oliver Marks 2018-09-08 21:55:36 +01:00 committed by GitHub
parent 914df8b0c7
commit b008edae90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ local ok, error = pcall( function()
if sEvent == "modem_message" then
-- Got a modem message, rebroadcast it if it's a rednet thing
if nChannel == rednet.CHANNEL_REPEAT then
if type( tMessage ) == "table" and tMessage.nMessageID and tMessage.nRecipient then
if type( tMessage ) == "table" and tMessage.nMessageID and tMessage.nRecipient and type(tMessage.nRecipient) == "number" then
if not tReceivedMessages[ tMessage.nMessageID ] then
-- Ensure we only repeat a message once
tReceivedMessages[ tMessage.nMessageID ] = true