Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1727

ComponentMetadataPersister is using dangerous characters in regular expression replacement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.1.0.FINAL
    • 5.1.0.CR3
    • None
    • None

    Description

      private static String extractFqcn(String path, File f) {
            return f.getAbsolutePath().replace(path, "").replace(File.separator, ".").replace(".class<span class="code-quote">", "").replaceFirst(".", "");
         }
      

      A problem is here - at least I think so as I've not seen any complaints; while "replace" is expecting a literal, "replaceFirst" is taking first argument as a regex pattern to match; and "." is a wildcard..

      This method is a good candidate for a unit test but I'm not understanding what the purpose is - if someone could plase add examples of intended functionality.

      Attachments

        Activity

          People

            manik_jira Manik Surtani (Inactive)
            sgrinove Sanne Grinovero
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: