Skip to content

[SECURITY] Fix Temporary File Information Disclosure Vulnerability #20

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

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 @@ -24,6 +24,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SequenceInputStream;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
Expand Down Expand Up @@ -365,7 +366,7 @@ private File mergeChunks(final Resource parentResource,
SequenceInputStream mergeStrm = null;
File file = null;
try {
file = File.createTempFile("tmp-", "-mergechunk");
file = Files.createTempFile("tmp-", "-mergechunk").toFile();
out = new FileOutputStream(file);
String startPattern = SlingPostConstants.CHUNK_NODE_NAME + "_" + "0_";
Iterator<Resource> itr = new FilteringResourceIterator(parentResource.listChildren(), startPattern);
Expand Down Expand Up @@ -595,4 +596,4 @@ private Resource createWithChanges(final Resource parent, final String name,
return result;
}

}
}