From 42fb0b10f49cf84a775fee5cc4a704bfc28ac36b Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Sat, 30 Mar 2019 15:46:46 +1030 Subject: [PATCH] Add bounds checking for packet 51, type = 4 --- TShockAPI/GetDataHandlers.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 1f041e4a..bd09f992 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3632,6 +3632,12 @@ namespace TShockAPI return true; } + if (type == 4 && (id < 0 || id > Main.npc.Length)) + { + //Type == 4 -> 'BigMimicSpawnSmoke'. This access Main.npc without any bounds checking on Terraria's side. + return true; + } + return false; }