You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2010/07/07 15:51:52 UTC

[jira] Resolved: (CLI-193) StringIndexOutOfBoundsException in HelpFormatter.findWrapPos

     [ https://issues.apache.org/jira/browse/CLI-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg resolved CLI-193.
--------------------------------

    Resolution: Fixed

Thank you for the patch Chris. I applied the change you suggested and it seems to work fine.

> StringIndexOutOfBoundsException in HelpFormatter.findWrapPos
> ------------------------------------------------------------
>
>                 Key: CLI-193
>                 URL: https://issues.apache.org/jira/browse/CLI-193
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.2
>            Reporter: Travis McLeskey
>            Priority: Critical
>             Fix For: 1.3
>
>         Attachments: cli-helpformatter-stringIndexOOB-2.patch, cli-helpformatter-stringIndexOOB-3.patch, cli-helpformatter-stringIndexOOB.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.