Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String sanitizePath(String sUnsanitized) throws URISyntaxException, EncodingException {
- String sSanitized = SAPI.encoder().canonicalize(sUnsanitized);
- return sSanitized;
- }
- //// the main method code snippet /////
- String sSanitizedPath = Utils.sanitizePath(file.getOriginalFilename());
- -- fortify scan detects problem here ..in below line --
- File filePath = new File(AppInitializer.UPLOAD_LOCATION, sSanitizedPath);
- String canonicalPath = filePath.getCanonicalPath();
- FileOutputStream fileOutputStream = new FileOutputStream(canonicalPath);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement