Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-202

URL Validator isValid method fails with java.lang.ArrayIndexOutOfBoundsException at org.apache.commons.validator.UrlValidator.isValidAuthority(UrlValidator.java:367)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.1 Release
    • None
    • None
    • JBOSS Running on Linux

    Description

      Validating the following URL will throw an ArrayIndexOutOfBoundsException exception

      http://www.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.log

      Code:

      String[] schemes =

      {"http","https"}

      .
      UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.NO_FRAGMENTS) ;
      urlValidator.isValid("http://www.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.log") ;

      Attachments

        1. 202-test.patch
          1 kB
          Henri Yandell
        2. 202-fix.patch
          0.9 kB
          Henri Yandell

        Issue Links

          Activity

            People

              bayard Henri Yandell
              shamsian Ben
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: