Fix swf exploit
This commit is contained in:
parent
6b73e4b51c
commit
dd1ba30a46
@ -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");
|
||||
@ -25,3 +29,4 @@ public class FTPUploadService {
|
||||
outputStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user