-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
sparc
-
solaris_2.5
-
Verified
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
--------------------------------------------------
======================================================================