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

the constructor for java.util.zip.ZipFile throws java.util.zip.ZipException: ex

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      03
    • CPU:
      x86
    • OS:
      windows_nt

      Backports

        Description



        Name: pa48320 Date: 11/15/2001

        When reading an archive, the constructor for java.util.zip.ZipFile is called so that we can read the file.
        The constructor for ZipFile throws an exception when the zip entry contains an extra field that is greater than 256 bytes.
        This prevents me from reading the file as this exception will always be thrown if the extra field is greater than
        256 bytes.

        The Java API (via the java.util.zip.ZipEntry class) allows me to create a zip entry that contains an extra field
        up to 0xFFFFF bytes in length. Therefore the read should not limit this field to 256 bytes.
        This bug exists for 1.4.0-beta3, 1.3.1.01, and 1.3.0_01. This bug does not exist in the 1.2.2 version.

        Output:

        java.util.zip.ZipException: extra header info exceeds 256 byte
                at java.util.zip.ZipFile.open(Native Method)
                at java.util.zip.ZipFile.<init>(ZipFile.java:110)
                at java.util.zip.ZipFile.<init>(ZipFile.java:75)


        Code Snippet:

         try
        {
           // where the zip file identified by name, has an extra field > 256 bytes
           ZipFile zipFile = new ZipFile(name);
        }
        catch (ZipException e)
        {
        }


        This is a regression that needs to be fixed to support current and future products.

        This has been tested and found to be a problem in the following versions:

        java version "1.4.0-beta3"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
        Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

        java version "1.3.1_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01a)
        Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

        java version "1.3.0_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
        Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)


        ======================================================================


        ###@###.### 2001-11-21
        also, the name is limited in the same way

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kkladkosunw Konstantin Kladko (Inactive)
                Reporter:
                pallenba Peter Allenbach (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: