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

Sebb resolved IO-683.
---------------------
    Fix Version/s: 2.8
       Resolution: Fixed

commit a521b43e774a92f4c07461536ffc810715c762d8

    IO-683 failure to convert byte to unsigned

    CircularBufferInputStream.read() fails to convert byte to unsigned int
---
 src/changes/changes.xml                            |  3 +++
 .../io/input/buffer/CircularBufferInputStream.java |  2 +-
 .../buffer/CircularBufferInputStreamTest.java      | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)


> CircularBufferInputStream.read() fails to convert byte to unsigned int
> ----------------------------------------------------------------------
>
>                 Key: IO-683
>                 URL: https://issues.apache.org/jira/browse/IO-683
>             Project: Commons IO
>          Issue Type: Bug
>            Reporter: Sebb
>            Assignee: Sebb
>            Priority: Major
>             Fix For: 2.8
>
>
> The method int CircularBufferInputStream.read() returns 
> CircularByteBuffer.read() which a byte. 
> However it does not convert it to an unsigned byte, so byte values outside 
> the range 0-127 will be sign-extended to a negative value.
> This is wrong, and can result in premature EOF.
> Note: this bug was reported by Sonarlint.
> Spotbugs does not appear to detect the bug.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to