Commons Compress
  1. Commons Compress
  2. COMPRESS-23

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

    Details

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

      Operating System: All
      Platform: All

      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; }

      }

        Issue Links

          Activity

            People

            • Assignee:
              Torsten Curdt
              Reporter:
              Adrian Pronk
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development