0
最近,我使用AppScan Source來掃描編碼,發現了一個我不知道如何修復並傳遞到掃描儀的結果,或者這是虛驚嗎?如何防止在Java中找到「Validation.EncodingRequired」
這是我的代碼。
public static void copyFileUsingFileStreams(File source, File dest)
throws IOException
{
InputStream input = null;
OutputStream output = null;
try
{
input = new FileInputStream(source);
output = new FileOutputStream(dest);
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead); //Scanner reported that's a vulnerability in API OutputStream.write()
}
}
finally
{
input.close();
output.close();
}
}
感謝chiastic解釋此事:-) – 2014-10-29 09:10:06