Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11225

NPE when using RelativePathPredicate with a path starting by ".."

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.6
    • Component/s: Scanner
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      https://github.com/SonarSource/sonar-go/issues/339

      For example, trying to find the input file for ../../../../../usr/local/go/src/net/lookup_unix.go fails with:

      05:04:36.863 ERROR: Error during SonarQube Scanner execution
      java.lang.NullPointerException
      	at org.sonar.api.batch.fs.internal.RelativePathPredicate.apply(RelativePathPredicate.java:46)
      	at org.sonar.api.batch.fs.internal.OrPredicate.apply(OrPredicate.java:60)
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
      	at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812)
      	at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
      	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
      	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
      	at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
      	at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
      	at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:117)
      	at org.sonar.go.plugin.externalreport.AbstractReportSensor.getInputFile(AbstractReportSensor.java:126)
      

      it should instead return the correct InputFile, or empty if the file is not indexed.

        Attachments

          Activity

            People

            • Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              julien.henry Julien Henry
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: