8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests
authorjuh
Tue, 22 Oct 2013 11:57:38 -0700
changeset 21329 c8ed09765b9a
parent 21328 13dbd66f4c09
child 21330 7b073d91ba9e
child 21332 a30659b9baf9
8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests Reviewed-by: mullan
jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java
--- a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java	Tue Oct 22 11:25:01 2013 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java	Tue Oct 22 11:57:38 2013 -0700
@@ -307,7 +307,7 @@
                                               : anchor.getCAPublicKey();
         }
         crlSignFlag = true;
-        if (params.certPath() != null) {
+        if (params != null && params.certPath() != null) {
             certIndex = params.certPath().getCertificates().size() - 1;
         } else {
             certIndex = -1;
--- a/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java	Tue Oct 22 11:25:01 2013 -0700
+++ b/jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java	Tue Oct 22 11:57:38 2013 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6854712 7171570 8010748
+ * @bug 6854712 7171570 8010748 8025287
  * @summary Basic unit test for PKIXRevocationChecker
  */
 
@@ -44,6 +44,8 @@
         CertPathChecker cpc = cpv.getRevocationChecker();
         PKIXRevocationChecker prc = (PKIXRevocationChecker)cpc;
 
+        prc.init(false);
+
         System.out.println("Testing that get methods return null or " +
                            "empty lists/sets/maps");
         requireNull(prc.getOcspResponder(), "getOcspResponder()");