admin管理员组文章数量:1401460
I have batch writer class to get the files from the directory but getting the CWE 73 flaw in the below mentioned line. is anyone have a solution to mitigate this flaw?
this.Dir - this is the DB property name to get the path from DB.
String filePath;
File folder=new File(this.Dir); //CWE 73 flaw detected
File[] listOfFiles = folder.listFiles();
if (null != listOfFiles && listOfFiles.length > 0) {
for (File file : listOfFiles) {
if (listOfFiles.length > 1)
filePath = file.getAbsolutePath();
I gone through the below veracode documentation but still i am not getting possible fix for above mentioned code.
版权声明:本文标题:java - How to fix flaws of the type CWE 73 External Control of File Name or Path (new File) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744240711a2596775.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论