Permalink
Browse files

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.
  • Loading branch information...
osmarks committed Sep 8, 2018
1 parent 914df8b commit b008edae90eb57a7771197546fe6e80fa63369e8
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/resources/assets/computercraft/lua/rom/programs/rednet/repeat.lua
@@ -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

0 comments on commit b008eda

Please sign in to comment.