-
Bug
-
Resolution: Unresolved
-
P4
-
8, 26
-
Fix Understood
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The test case triggers a NullPointerException in CodeSource.getCodeSigners() when a CodeSource instance is constructed with an empty certificate array (new java.security.cert.Certificate[0]). The signers field remains null after the constructor finishes, yet the getCodeSigners() method attempts to call signers.clone() without checking for null, resulting in the NPE.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.net.URL;
import java.security.CodeSource;
public class CertsMatch {
public static void main(String[] args) throws Exception {
File certsFile = new File(System.getProperty("test.src", "."), "certs");
URL location = certsFile.toURI().toURL();
CodeSource csEmptyCerts = new CodeSource(location, new java.security.cert.Certificate[0]);
csEmptyCerts.getCodeSigners();
}
}
---------- END SOURCE ----------
The test case triggers a NullPointerException in CodeSource.getCodeSigners() when a CodeSource instance is constructed with an empty certificate array (new java.security.cert.Certificate[0]). The signers field remains null after the constructor finishes, yet the getCodeSigners() method attempts to call signers.clone() without checking for null, resulting in the NPE.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.net.URL;
import java.security.CodeSource;
public class CertsMatch {
public static void main(String[] args) throws Exception {
File certsFile = new File(System.getProperty("test.src", "."), "certs");
URL location = certsFile.toURI().toURL();
CodeSource csEmptyCerts = new CodeSource(location, new java.security.cert.Certificate[0]);
csEmptyCerts.getCodeSigners();
}
}
---------- END SOURCE ----------