fine if you think you can still exploit it then good luck now

This commit is contained in:
Lemon 2019-07-28 17:39:00 +05:00
parent de1fbde20a
commit 27aaa5406d

View File

@ -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.ClipboardFormat;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -223,6 +225,16 @@ public class Module_schematic extends HTTPDModule
FileUtils.deleteQuietly(targetFile); FileUtils.deleteQuietly(targetFile);
throw new SchematicTransferException("Schematic is not a valid schematic."); 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()); FLog.info(remoteAddress + " uploaded schematic: " + targetFile.getName());
} }