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

TarUtils.parseName does not properly handle characters outside the range 0-127

    Details

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

      Windows/Suse

      Description

      if a tarfile contains files with special characters, the names of the tar entries are wrong.

      example:
      correct name: 0302-0601-3±±±F06±W220±ZB±LALALA±±±±±±±±±±CAN±±DC±±±04±060302±MOE.model
      name resolved by TarUtils.parseName: 0302-0101-3ᄆᄆᄆF06ᄆW220ᄆZBᄆHECKMODULᄆᄆᄆᄆᄆᄆᄆᄆᄆᄆECEᄆᄆDCᄆᄆᄆ07ᄆ060302ᄆDOERN.model

      please use:
      result.append(new String(new byte[]

      { buffer[i] }

      ));

      instead of:
      result.append((char) buffer[i]);

      to solve this encoding problem.

        Attachments

        1. plusMinusForJIRAwithLicense.tar
          10 kB
          Helmut Minst
        2. TarArchiveEntry.java
          20 kB
          Helmut Minst
        3. TarArchiveInputStream.java
          11 kB
          Helmut Minst
        4. TarUtils.java
          9 kB
          Helmut Minst

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hminst Helmut Minst
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: