[
https://issues.apache.org/jira/browse/IO-780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17718322#comment-17718322
]
Marcono1234 edited comment on IO-780 at 5/1/23 6:52 PM:
--------------------------------------------------------
Sorry I am not planning to submit a pull request for this at the moment. In the
original pull request I wasn't sure whether the changes were too extensive, and
it might have tried to address to much at once because it also included a
potential fix for IO-781. See also [this comment on the pull
request|https://github.com/apache/commons-io/pull/293#issuecomment-1242977393].
Also, it was still unclear whether these changes would require the CLA to be
signed (see
[comment|https://github.com/apache/commons-io/pull/293#issuecomment-1100902003]);
and I don't want to sign the Apache CLA at the moment (and neither do I want
to invest much time into a potential fix if in the end it turns out signing the
CLA is required).
was (Author: marcono1234):
Sorry I am not planning to submit a pull request for this at the moment. In the
original pull request I wasn't sure whether the changes were too extensive, and
it might have tried to address to much at once because it also included a
potential fix for IO-781. See also [this comment on the pull
request|https://github.com/apache/commons-io/pull/293#issuecomment-1242977393].
Also, it was still unclear whether these changes would require the CLA to be
signed (see
[comment|https://github.com/apache/commons-io/pull/293#issuecomment-1100902003]);
and I don't want to sign the Apache CLA at the moment (and neither do I want
to invest much time into this if in the end it turns out signing the CLA is
required).
> ReaderInputStream discards some encoding errors
> -----------------------------------------------
>
> Key: IO-780
> URL: https://issues.apache.org/jira/browse/IO-780
> Project: Commons IO
> Issue Type: Bug
> Components: Streams/Writers
> Affects Versions: 2.11.0
> Reporter: Marcono1234
> Priority: Major
>
> h3. Description
> {{org.apache.commons.io.input.ReaderInputStream}} discards encoder errors in
> some cases instead of properly rethrowing them.
> The underlying issue is that {{lastCoderResult}} is re-assigned before it has
> been checked for errors and overflow ([link to
> code|https://github.com/apache/commons-io/blob/b9e4f5e6e718ec8e4156e31bef733874700d7cbf/src/main/java/org/apache/commons/io/input/ReaderInputStream.java#L267]).
> This was originally mentioned in pull request
> [#293|https://github.com/apache/commons-io/pull/293].
> h3. Example
> The {{read()}} call in the following example should throw an exception, but
> currently it erroneously returns -1.
> {code}
> // Encoder which throws on malformed or unmappable input
> CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();
> ReaderInputStream in = new ReaderInputStream(new StringReader("\uD800"),
> encoder);
> // BUG: This should have thrown an exception because the input is malformed
> System.out.println("Read: " + in.read());
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)