DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32629>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32629

           Summary: Compress: TarInputStream.read() returns wrong values
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Sandbox
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to