[
https://issues.apache.org/jira/browse/COMPRESS-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Lundberg moved SANDBOX-44 to COMPRESS-33:
------------------------------------------------
Component/s: (was: Compress)
Affects Version/s: (was: Nightly Builds)
Key: COMPRESS-33 (was: SANDBOX-44)
Project: Commons Compress (was: Commons Sandbox)
> [compress] TarInputStream.read() returns wrong values
> -----------------------------------------------------
>
> Key: COMPRESS-33
> URL: https://issues.apache.org/jira/browse/COMPRESS-33
> Project: Commons Compress
> Issue Type: Bug
> Environment: Operating System: All
> Platform: All
> Reporter: Christian Kohlschütter
>
> There is a bug in the read() method of sandbox' compress TarInputStream, which
> will be triggered only when bytes greater than 127 are being read because of a
> bad implicit cast from "byte" to "int" (values >= 128 result in negative int
> values, because "byte" is signed). I discovered this when applying a
> DataInputStream, which makes heavy use of InputStream.read().
> Possible Fix:
> Change the "return" line from the TarInputStream.read() function from
> return (int)m_oneBuf[ 0 ];
> to
> return (int) (m_oneBuf[0] & 0xFF);
> Best regards,
> Christian
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.