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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 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

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

              Dates

                Created:
                Updated:
                Resolved: