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

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

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: