Fixed campaign idle boss spoofing
This commit is contained in:
@@ -27,6 +27,8 @@ import java.util.zip.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class LogicBlock extends Block{
|
||||
private static final int maxByteLen = 1024 * 500;
|
||||
|
||||
public int maxInstructionScale = 5;
|
||||
public int instructionsPerTick = 1;
|
||||
public float range = 8 * 10;
|
||||
@@ -137,6 +139,9 @@ public class LogicBlock extends Block{
|
||||
stream.read();
|
||||
|
||||
int bytelen = stream.readInt();
|
||||
|
||||
if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen);
|
||||
|
||||
byte[] bytes = new byte[bytelen];
|
||||
stream.readFully(bytes);
|
||||
|
||||
@@ -197,6 +202,7 @@ public class LogicBlock extends Block{
|
||||
int version = stream.read();
|
||||
|
||||
int bytelen = stream.readInt();
|
||||
if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen);
|
||||
byte[] bytes = new byte[bytelen];
|
||||
stream.readFully(bytes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user