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

Unable to extract Zip with unknown UniCode path extra data version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.18
    • 1.19
    • Archivers

    Description

      The following exception is thrown when the version of the UniCode path extra data version is not 1. 7-Zip and Windows Explorer will extract the attached file. The version in the file was changed via a Hex editor to provoke the error.

      java.lang.RuntimeException: Error parsing extra fields for entry: %U20AC_for_Dollar.txt - Unsupported version [116] for UniCode path extra data.
      
      	at org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setExtra(ZipArchiveEntry.java:626)
      	at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:315)
      	at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextEntry(ZipArchiveInputStream.java:408)
      	at org.apache.commons.compress.archivers.zip.UTF8ZipFilesTest.testZipFileReadsUnicodeFields(UTF8ZipFilesTest.java:186)
      ...
      Caused by: java.util.zip.ZipException: Unsupported version [116] for UniCode path extra data.
      	at org.apache.commons.compress.archivers.zip.AbstractUnicodeExtraField.parseFromLocalFileData(AbstractUnicodeExtraField.java:172)
      	at org.apache.commons.compress.archivers.zip.ExtraFieldUtils.parse(ExtraFieldUtils.java:180)
      	at org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setExtra(ZipArchiveEntry.java:620)
      

      As I understand the specification in Section 4.6.8 and 4.6.9 when the version is unknown the information shoule be ignored.

      Changes MAY NOT be backward compatible so this extra field SHOULD NOT be used if the version is not recognized.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rschimpf Robin Schimpf
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m