Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313765

Invalid CEN header (invalid zip64 extra data field size)

XMLWordPrintable

    • 21
    • b11
    • Verified

        The following ZipException may be thrown when the data contained in the CEN Extra fields are problematic:

              Invalid CEN header (invalid zip64 extra data field size)


        The ZipException may occur due to:

         1. Some releases of Ant and commons-compress create CEN Zip64 extra headers with a size of 0 when Zip64 mode is required
           - fixed in Commons-compress 1.11 (2016) and Ant 1.10.14 (2023).
         2. Extra field includes padding not included in the Extra data field headers
         3. The BND tool added problematic data to the extra field
            - fixed in BND 5.3 (2021) and maven-bundle-plugin 5.1.5 which includes BND 5.3



        The issue can demonstrated via the following ant script :

        ?xml version="1.0"?>
        <project name="zip 64 jar test" basedir="." default="jar">
            <property name="jarFile" value="test.jar"/>
            <property name="builddir" value="classes"/>

            <target name="jar">
                <jar destfile="${jarFile}"
                     zip64mode="always"
                     basedir="${builddir}"/>
            </target>
        </project>


              lancea Lance Andersen
              lancea Lance Andersen
              Votes:
              0 Vote for this issue
              Watchers:
              24 Start watching this issue

                Created:
                Updated:
                Resolved: