Skip to content

Commit b008eda

Browse files
authored
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.
1 parent 914df8b commit b008eda

File tree

1 file changed

+1
-1
lines changed
  • src/main/resources/assets/computercraft/lua/rom/programs/rednet

1 file changed

+1
-1
lines changed

src/main/resources/assets/computercraft/lua/rom/programs/rednet/repeat.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ local ok, error = pcall( function()
4444
if sEvent == "modem_message" then
4545
-- Got a modem message, rebroadcast it if it's a rednet thing
4646
if nChannel == rednet.CHANNEL_REPEAT then
47-
if type( tMessage ) == "table" and tMessage.nMessageID and tMessage.nRecipient then
47+
if type( tMessage ) == "table" and tMessage.nMessageID and tMessage.nRecipient and type(tMessage.nRecipient) == "number" then
4848
if not tReceivedMessages[ tMessage.nMessageID ] then
4949
-- Ensure we only repeat a message once
5050
tReceivedMessages[ tMessage.nMessageID ] = true

0 commit comments

Comments
 (0)