Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-497

Rule S1313 should not raise on invalid IP address or part of exceptions

    XMLWordPrintable

    Details

      Description

      IPv4 addresses with "leading" zero, a zero preceding another digit, are invalid ("0.00.0.0", "1.02.1.1" ...) and we should not raise in this case (it will decrease the number of FPs).

      • Go
        ip = "0.00.0.0" // Compliant
        ip = "1.2.03.4" // Compliant
        
      • Ruby
        ip = "0.00.0.0" # Compliant
        ip = "1.2.03.4" # Compliant
        
      • Scala
        val ip = "0.00.0.0" // Compliant
        val ip = "1.2.03.4" // Compliant
        
      • Kotlin
        val ip = "0.00.0.0" // Compliant
        val ip = "1.2.03.4" // Compliant
        
      • Apex
        String ip = '0.00.0.0'; // Compliant
        String ip = '1.2.03.4'; // Compliant
        

      IPv6 addresses are not concerned by these exceptions

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              margarita.nedzelska Margarita Nedzelska
              Reporter:
              eric.therond Eric Therond
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: