Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 1235 invoked from network); 9 May 2008 01:45:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 May 2008 01:45:18 -0000 Received: (qmail 34167 invoked by uid 500); 9 May 2008 01:45:20 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 34151 invoked by uid 500); 9 May 2008 01:45:20 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 34140 invoked by uid 99); 9 May 2008 01:45:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 May 2008 18:45:20 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 May 2008 01:44:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B014D234C110 for ; Thu, 8 May 2008 18:44:55 -0700 (PDT) Message-ID: <647871627.1210297495720.JavaMail.jira@brutus> Date: Thu, 8 May 2008 18:44:55 -0700 (PDT) From: "Benson Margulies (JIRA)" To: issues@cxf.apache.org Subject: [jira] Resolved: (CXF-1571) CachedOutputStream#writeCacheTo(StringBuilder, int) fails with StringIndexOutOfBoundsException In-Reply-To: <68412512.1210067275832.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benson Margulies resolved CXF-1571. ----------------------------------- Resolution: Fixed Fix Version/s: 2.1.1 Committed to trunk. > CachedOutputStream#writeCacheTo(StringBuilder, int) fails with StringIndexOutOfBoundsException > ---------------------------------------------------------------------------------------------- > > Key: CXF-1571 > URL: https://issues.apache.org/jira/browse/CXF-1571 > Project: CXF > Issue Type: Bug > Components: Core > Affects Versions: 2.1 > Reporter: Axel Dehning > Assignee: Benson Margulies > Fix For: 2.1.1 > > > public void writeCacheTo(StringBuilder out, int limit) throws IOException { > ... > if ((count + x) > limit) { > x = count - limit; <<< this has to be: x = limit - count; > } > out.append(new String(bytes, 0, x)); > count += x; > ... > } > If limit is reached x becomes negative and String construction fails with > java.lang.StringIndexOutOfBoundsException: String index out of range: -784 > at java.lang.String.checkBounds(String.java:368) > at java.lang.String.(String.java:457) > at org.apache.cxf.io.CachedOutputStream.writeCacheTo(CachedOutputStream.java:272) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.