From 27aaa5406d3e0a60abbb561ec2e3d35a6571e14b Mon Sep 17 00:00:00 2001 From: Lemon Date: Sun, 28 Jul 2019 17:39:00 +0500 Subject: [PATCH] fine if you think you can still exploit it then good luck now --- .../httpd/module/Module_schematic.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java index 92e1d8ee..a7dcca64 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java @@ -2,7 +2,9 @@ package me.totalfreedom.totalfreedommod.httpd.module; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; +import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -223,6 +225,16 @@ public class Module_schematic extends HTTPDModule FileUtils.deleteQuietly(targetFile); throw new SchematicTransferException("Schematic is not a valid schematic."); } + try + { + ClipboardReader reader = format.getReader(new FileInputStream(targetFile)); + } + catch (IOException e) + { + FileUtils.deleteQuietly(targetFile); + throw new SchematicTransferException("Schematic is not a valid schematic."); + } + FLog.info(remoteAddress + " uploaded schematic: " + targetFile.getName()); }