Skip to content

Commit

Permalink
Merge pull request from GHSA-pc22-3g76-gm6j
Browse files Browse the repository at this point in the history
 security: use java.nio.files in Generator.
  • Loading branch information
frantuma authored Mar 2, 2021
2 parents a4b766b + 3b40539 commit 987ea7a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -173,9 +174,7 @@ public static InputOption serverOptions(@SuppressWarnings("unused") String langu

protected static File getTmpFolder() {
try {
File outputFolder = File.createTempFile("codegen-", "-tmp");
outputFolder.delete();
outputFolder.mkdir();
File outputFolder = Files.createTempDirectory("codegen-").toFile();
outputFolder.deleteOnExit();
return outputFolder;
} catch (Exception e) {
Expand Down

0 comments on commit 987ea7a

Please sign in to comment.