Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static FileCollectionStorage create(TorrentMetadata metadata, File parent
for (TorrentFile file : metadata.getFiles()) {
File actual = new File(parent, file.getRelativePathAsString());

if (!actual.getCanonicalPath().startsWith(parent.getCanonicalPath())) {
if (!actual.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())) {
throw new SecurityException("Torrent file path attempted " +
"to break directory jail!");
}
Expand Down