changeset 21329:c8ed09765b9a

8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests Reviewed-by: mullan
author juh
date Tue, 22 Oct 2013 11:57:38 -0700
parents 13dbd66f4c09
children 7b073d91ba9e a30659b9baf9
files jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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()");