Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-23

[compress] TarInputStream returns negative value for read() [PATCH]

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      36243

      Description

      TarInputStream.read() does not convert the byte it has read to a positive number
      after casting it to an integer. This causes downstream processes to fail to
      recognise the value properly.

      Index: org/apache/commons/compress/tar/TarInputStream.java
      ===================================================================
      — org/apache/commons/compress/tar/TarInputStream.java (revision 231420)
      +++ org/apache/commons/compress/tar/TarInputStream.java (working copy)
      @@ -306,7 +306,7 @@
      }
      else

      { - return (int)m_oneBuf[ 0 ]; + return (int)m_oneBuf[ 0 ] & 0xFF; }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tcurdt Torsten Curdt
                Reporter:
                ajmp1960@hotmail.com Adrian Pronk
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: