commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (SANDBOX-44) [compress] TarInputStream.read() returns wrong values
Date Wed, 05 Jul 2006 03:57:40 GMT
     [ http://issues.apache.org/jira/browse/SANDBOX-44?page=all ]

Henri Yandell updated SANDBOX-44:
---------------------------------

    Component: Compress

> [compress] TarInputStream.read() returns wrong values
> -----------------------------------------------------
>
>          Key: SANDBOX-44
>          URL: http://issues.apache.org/jira/browse/SANDBOX-44
>      Project: Commons Sandbox
>         Type: Bug

>   Components: Compress
>     Versions: Nightly Builds
>  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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message