# HG changeset patch # User juh # Date 1382468258 25200 # Node ID c8ed09765b9a3fe6a81dfc1bd50cfe1b2bf88491 # Parent 13dbd66f4c0924d2c0405c993c0456664e4cc07d 8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests Reviewed-by: mullan diff -r 13dbd66f4c09 -r c8ed09765b9a jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.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; diff -r 13dbd66f4c09 -r c8ed09765b9a jdk/test/java/security/cert/PKIXRevocationChecker/UnitTest.java --- 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()");