Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 47986 invoked from network); 13 Jun 2010 16:01:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Jun 2010 16:01:41 -0000 Received: (qmail 18074 invoked by uid 500); 13 Jun 2010 15:01:39 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17973 invoked by uid 500); 13 Jun 2010 15:01:38 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 17965 invoked by uid 99); 13 Jun 2010 15:01:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jun 2010 15:01:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jun 2010 15:01:36 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5DF1ENr017587 for ; Sun, 13 Jun 2010 15:01:14 GMT Message-ID: <10756636.68881276441274399.JavaMail.jira@thor> Date: Sun, 13 Jun 2010 11:01:14 -0400 (EDT) From: "Chris Lee (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (CLI-193) StringIndexOutOfBoundsException in HelpFormatter.findWrapPos In-Reply-To: <1528495818.20601264211961544.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLI-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Lee updated CLI-193: -------------------------- Attachment: cli-helpformatter-stringIndexOOB.patch Here is a patch that adds a test case and applies the fix suggested by Travis. > 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.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.