Fix swf exploit

This commit is contained in:
Remco 2020-11-18 13:00:41 +01:00
parent 6b73e4b51c
commit dd1ba30a46

View File

@ -7,11 +7,15 @@ import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Arrays;
public class FTPUploadService {
private static final String ftpUrl = "ftp://%s:%s@%s/%s;type=i";
public static void uploadImage(byte[] image, String uploadPath) throws IOException{
byte[] pngSignature = new byte[] { -119, 80, 78, 71, 13, 10, 26, 10 };
if (Arrays.equals(Arrays.copyOfRange(image, 0, 8), pngSignature)) {
String host = Emulator.getConfig().getValue("ftp.host");
String user = Emulator.getConfig().getValue("ftp.user");
String pass = Emulator.getConfig().getValue("ftp.password");
@ -24,4 +28,5 @@ public class FTPUploadService {
outputStream.write(image, 0, image.length);
outputStream.close();
}
}
}