struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-4383) An infinite loop occurs in FastByteArrayOutputStream.java.
Date Tue, 05 Aug 2014 05:50:11 GMT

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

Lukasz Lenart updated WW-4383:
------------------------------

    Fix Version/s: 2.3.18

> 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
>             Fix For: 2.3.18
>
>   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)

Mime
View raw message