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

Fix Temporary File Information Disclosure Vulnerability in tests #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 @@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Properties;
Expand Down Expand Up @@ -154,7 +155,7 @@ public static File createTempFile( byte[] pattern, int repeat )
throws IOException
{
mkdirs( TMP );
File tmpFile = File.createTempFile( "tmpfile-", ".data", TMP );
File tmpFile = Files.createTempFile( TMP.toPath(), "tmpfile-", ".data" ).toFile();
writeBytes( tmpFile, pattern, repeat );
return tmpFile;
}
Expand All @@ -169,7 +170,7 @@ public static File createTempDir( String suffix )
throws IOException
{
mkdirs( TMP );
File tmpFile = File.createTempFile( "tmpdir-", suffix, TMP );
File tmpFile = Files.createTempFile( TMP.toPath(), "tmpdir-", suffix ).toFile();
deleteFile( tmpFile );
mkdirs( tmpFile );
return tmpFile;
Expand Down