1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-19 08:52:15 +01:00

Improved sanity checks on filenames in package_index.json

This commit is contained in:
Cristian Maglie 2020-01-21 10:42:12 +01:00 committed by Cristian Maglie
parent 0f5d22c67c
commit b811689e97

View File

@ -62,7 +62,9 @@ public class DownloadableContributionsDownloader {
public File download(DownloadableContribution contribution, Progress progress, final String statusText, ProgressListener progressListener, boolean noResume, boolean allowCache) throws Exception {
URL url = new URL(contribution.getUrl());
Path outputFile = Paths.get(stagingFolder.getAbsolutePath(), contribution.getArchiveFileName());
// Filter out paths from file name
String filename = new File(contribution.getArchiveFileName()).getName();
Path outputFile = Paths.get(stagingFolder.getAbsolutePath(), filename);
// Ensure the existence of staging folder
Files.createDirectories(stagingFolder.toPath());