Skip to content

Commit

Permalink
Fix a crash in rednet repeat
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
osmarks authored Sep 8, 2018
1 parent 914df8b commit b008eda
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b008eda

Please # to comment.