Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terminating separator to avoid path escaping #2288

Merged
merged 11 commits into from
Jul 28, 2022
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static String readFileToString(String filePath) throws IOException {
}

private static String validateFileName(String fileName, File destinationFolder) throws IOException {
String destinationFolderCanonicalPath = destinationFolder.getCanonicalPath();
String destinationFolderCanonicalPath = destinationFolder.getCanonicalPath() + File.separator;

File file = new File(destinationFolderCanonicalPath, fileName);
String canonicalPath = file.getCanonicalPath();
Expand Down