Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-193

StringIndexOutOfBoundsException in HelpFormatter.findWrapPos

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.2
    • 1.3
    • CLI-1.x
    • None

    Description

      In the last while loop in HelpFormatter.findWrapPos, it can pass text.length() to text.charAt(int), which throws a StringIndexOutOfBoundsException. The first expression in that while loop condition should use a <, not a <=.

      This is on line 908 in r779646:
      http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/java/org/apache/commons/cli/HelpFormatter.java?revision=779646&view=markup

      Attachments

        Activity

          People

            Unassigned Unassigned
            motravo Travis McLeskey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified