• RAhsan891366 (Community Member)

      Hi @Dee, Veracode Security Consultant (Veracode)​ ,

      I tried multiple solutions from this article but still it's not reslved.

      Here I am adding the code snippet for your better understanding.

       

      String dbFilePath = SystemProperties.getProperty("db_files_path");

      String safeFileName = FilenameUtils.getName(fileName);

      File newFile = new File(safeDbFilePath + "/" + safeFileName);

      The bold line is where I'm getting the issue.

       

      ============================================================

       public static String getName(final String fileName) {

          if (fileName == null) {

            return null;

          }

          failIfNullBytePresent(fileName);

          final int index = indexOfLastSeparator(fileName);

          return fileName.substring(index + 1);

        }

      Expand Post

Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.