mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-22 03:42:53 +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:
parent
914df8b0c7
commit
b008edae90
@ -44,7 +44,7 @@ local ok, error = pcall( function()
|
|||||||
if sEvent == "modem_message" then
|
if sEvent == "modem_message" then
|
||||||
-- Got a modem message, rebroadcast it if it's a rednet thing
|
-- Got a modem message, rebroadcast it if it's a rednet thing
|
||||||
if nChannel == rednet.CHANNEL_REPEAT then
|
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
|
if not tReceivedMessages[ tMessage.nMessageID ] then
|
||||||
-- Ensure we only repeat a message once
|
-- Ensure we only repeat a message once
|
||||||
tReceivedMessages[ tMessage.nMessageID ] = true
|
tReceivedMessages[ tMessage.nMessageID ] = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user