Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D678C1054C for ; Tue, 5 Aug 2014 05:46:13 +0000 (UTC) Received: (qmail 22791 invoked by uid 500); 5 Aug 2014 05:46:13 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 22704 invoked by uid 500); 5 Aug 2014 05:46:13 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 22586 invoked by uid 99); 5 Aug 2014 05:46:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2014 05:46:13 +0000 Date: Tue, 5 Aug 2014 05:46:13 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4383) An infinite loop occurs in FastByteArrayOutputStream.java. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4383: ------------------------------ Description: An infinite loop occurs in FastByteArrayOutputStream.java. The conditions which an infinite loop generates are as follows. - The character code of input data is UTF-8. - The length of input data is longer than 16 KB. - There is a character of a surrogate pair after 16 KB of input data. - Example of input data: The input data to reproduce repeats 3 bytes of character 5462 times, and the character of a surrogate pair appears behind that. - Cause Is clean of the out buffer necessary for decodeAndWritw method after the output in an out buffer? {code:java} private static CoderResult decodeAndWrite(Writer writer, ByteBuffer in, CharBuffer out, CharsetDecoder decoder, boolean endOfInput) throws IOException { CoderResult result = decoder.decode(in, out, endOfInput); // To begin of decoded data out.flip(); // Output writer.write(out.toString()); return result; } {code} was: An infinite loop occurs in FastByteArrayOutputStream.java. The conditions which an infinite loop generates are as follows. - The character code of input data is UTF-8. - The length of input data is longer than 16 KB. - There is a character of a surrogate pair after 16 KB of input data. - Example of input data: The input data to reproduce repeats 3 bytes of character 5462 times, and the character of a surrogate pair appears behind that. - Cause Is clean of the out buffer necessary for decodeAndWritw method after the output in an out buffer? {code:java} private static CoderResult decodeAndWrite(Writer writer, ByteBuffer in, CharBuffer out, CharsetDecoder decoder, boolean endOfInput) throws IOException { CoderResult result = decoder.decode(in, out, endOfInput); // To begin of decoded data out.flip(); // Output writer.write(out.toString()); return result; } {code} > An infinite loop occurs in FastByteArrayOutputStream.java. > ----------------------------------------------------------- > > Key: WW-4383 > URL: https://issues.apache.org/jira/browse/WW-4383 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.3.16.3 > Reporter: Suzuki Yoshifumi > Priority: Minor > Original Estimate: 672h > Remaining Estimate: 672h > > An infinite loop occurs in FastByteArrayOutputStream.java. > The conditions which an infinite loop generates are as follows. > - The character code of input data is UTF-8. > - The length of input data is longer than 16 KB. > - There is a character of a surrogate pair after 16 KB of input data. > - Example of input data: > The input data to reproduce repeats 3 bytes of character 5462 times, and the character of a surrogate pair appears behind that. > - Cause > Is clean of the out buffer necessary for decodeAndWritw method after the output in an out buffer? > {code:java} > private static CoderResult decodeAndWrite(Writer writer, ByteBuffer in, CharBuffer out, CharsetDecoder decoder, boolean endOfInput) throws IOException { > CoderResult result = decoder.decode(in, out, endOfInput); > // To begin of decoded data > out.flip(); > // Output > writer.write(out.toString()); > return result; > } > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)