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

java.util.zip.ZipFile methods available() and read() calculate incorrect bytes

    XMLWordPrintable

Details

    • 1.1fcs
    • sparc
    • solaris_2.5
    • Not verified

    Description


      In File: ZipFile.java

      Package: java.util.zip

      Class: ZipFileInputStream

      Methods: available() and read(...)

      The code for calulating the avalable bytes in the stream is incorrect.
      It is currently:

      available():

      317: return (int)Math.max(count, Integer.MAX_VALUE);

      which will always return MAX_VALUE. Math.min() should be called instead
      of Math.max().

      read(...):

      338: len = (int)Math.max(count, Integer.MAX_VALUE);

      should also call Math.min instead.

      Attachments

        Activity

          People

            dconnellsunw David Connelly (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: