Fixed #8760
This commit is contained in:
@@ -30,7 +30,7 @@ import java.util.zip.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class LogicBlock extends Block{
|
public class LogicBlock extends Block{
|
||||||
private static final int maxByteLen = 1024 * 500;
|
private static final int maxByteLen = 1024 * 100;
|
||||||
|
|
||||||
public int maxInstructionScale = 5;
|
public int maxInstructionScale = 5;
|
||||||
public int instructionsPerTick = 1;
|
public int instructionsPerTick = 1;
|
||||||
@@ -176,7 +176,7 @@ public class LogicBlock extends Block{
|
|||||||
|
|
||||||
int bytelen = stream.readInt();
|
int bytelen = stream.readInt();
|
||||||
|
|
||||||
if(bytelen > maxByteLen) throw new RuntimeException("Malformed logic data! Length: " + bytelen);
|
if(bytelen > maxByteLen) throw new RuntimeException("Logic data too long or malformed! Length: " + bytelen);
|
||||||
|
|
||||||
byte[] bytes = new byte[bytelen];
|
byte[] bytes = new byte[bytelen];
|
||||||
stream.readFully(bytes);
|
stream.readFully(bytes);
|
||||||
|
|||||||
Reference in New Issue
Block a user