Skip to content

Commit b811689

Browse files
committed
Improved sanity checks on filenames in package_index.json
1 parent 0f5d22c commit b811689

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arduino-core/src/cc/arduino/contributions/DownloadableContributionsDownloader.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public File download(DownloadableContribution contribution, Progress progress, f
6262

6363
public File download(DownloadableContribution contribution, Progress progress, final String statusText, ProgressListener progressListener, boolean noResume, boolean allowCache) throws Exception {
6464
URL url = new URL(contribution.getUrl());
65-
Path outputFile = Paths.get(stagingFolder.getAbsolutePath(), contribution.getArchiveFileName());
65+
// Filter out paths from file name
66+
String filename = new File(contribution.getArchiveFileName()).getName();
67+
Path outputFile = Paths.get(stagingFolder.getAbsolutePath(), filename);
6668

6769
// Ensure the existence of staging folder
6870
Files.createDirectories(stagingFolder.toPath());

0 commit comments

Comments
 (0)