You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2022/11/21 02:30:11 UTC
[servicecomb-java-chassis] branch master updated: vuln-fix: Temporary File Information Disclosure (#3488)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new eb95f33c3 vuln-fix: Temporary File Information Disclosure (#3488)
eb95f33c3 is described below
commit eb95f33c33773b8ac7c82d26936ff9281e82259f
Author: Jonathan Leitschuh <jo...@gmail.com>
AuthorDate: Sun Nov 20 18:30:05 2022 -0800
vuln-fix: Temporary File Information Disclosure (#3488)
---
.../servicecomb/foundation/vertx/http/TestFileUploadPart.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestFileUploadPart.java b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestFileUploadPart.java
index b36b6865b..f7d132ed3 100644
--- a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestFileUploadPart.java
+++ b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/http/TestFileUploadPart.java
@@ -20,7 +20,8 @@ package org.apache.servicecomb.foundation.vertx.http;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
@@ -32,8 +33,8 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
-
+import org.mockito.Mockito;
+
public class TestFileUploadPart {
FileUpload fileUpload;
@@ -46,7 +47,7 @@ public class TestFileUploadPart {
@BeforeAll
public static void classSetup() throws IOException {
- file = File.createTempFile("upload", ".txt");
+ file = Files.createTempFile("upload", ".txt").toFile();
file.deleteOnExit();
FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8, false);
}