Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 56985 invoked from network); 22 Jun 2010 20:58:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 20:58:19 -0000 Received: (qmail 42905 invoked by uid 500); 22 Jun 2010 20:58:19 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 42809 invoked by uid 500); 22 Jun 2010 20:58:18 -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 42801 invoked by uid 99); 22 Jun 2010 20:58:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 20:58:18 +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; Tue, 22 Jun 2010 20:58:16 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5MKvswg021564 for ; Tue, 22 Jun 2010 20:57:54 GMT Message-ID: <12201214.21631277240274813.JavaMail.jira@thor> Date: Tue, 22 Jun 2010 16:57:54 -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-3.patch Makes sense to me too. Doesn't help to have characters run only a *little* bit off the screen :) Here is an updated patch that will never exceed startPos+width. > 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.