Suzuki Yoshifumi created WW-4383:
------------------------------------
Summary: 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
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?
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;
}
--
This message was sent by Atlassian JIRA
(v6.2#6252)