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

java.util.zip.DeflaterOutputStream/InflaterInputStream ctors don't check for nul

    Details

    • Subcomponent:
      jar
    • Resolved In Build:
      1.2fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Verified

      Description



      Name: sdC67446 Date: 02/24/98


      Constructor java.util.zip.DeflaterOutputStream(OutputStream os)
      doesn't check input parameter for null. Thus calling the write method
      later causes undocumented NullPointerException.

      The similar bug is present in InflaterInputStream constructor as well.
      --------------------------------------------------

      Here is the test demonstrating the bug:
      -----------------Test.java------------------------
      import java.util.zip.*;
      import java.io.*;

      public class Test {
        
        public static void main(String[] args) {
          DeflaterOutputStream dos = new DeflaterOutputStream(null);
          try {
            dos.write(123);
          } catch (NullPointerException e) {
            System.out.println(e);
          } catch (IOException e) {
            System.out.println(e);
          }
        }
      }
      ---------Output from the test---------------------
      java.lang.NullPointerException
      --------------------------------------------------

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

        Attachments

          Activity

            People

            • Assignee:
              dconnellsunw David Connelly (Inactive)
              Reporter:
              sdmitriesunw Sergei Dmitriev (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: